underscore-unused-vars-lint: Underscore unused-vars lint policy #4

Open
std-bot wants to merge 2 commits from task/underscore-unused-vars-lint into main
First-time contributor

Assigned idea

Benchmark authoring specification.

Summary: Update the repo’s ESLint flat config so the existing underscore convention for unused args and vars also applies deterministically to caught errors, destructured array placeholders, and object rest siblings.

Task intent: Make an ordinary upstream-facing ESLint configuration improvement in yopedia: preserve the current Next.js flat config and warning-level @typescript-eslint/no-unused-vars rule, while extending its underscore-ignore convention to common TypeScript patterns that currently are not explicitly covered.

Benchmark plan: Construct the task package from the pinned repo commit with instructions focused only on the lint policy change. The solver-facing prompt should ask for a small ESLint configuration update that keeps the existing ignores and Next.js extends intact, and should not mention verifier internals. Include a verifier that checks both static config shape and lint behavior with a temporary TypeScript fixture.

Environment plan: The environment/repo is the yologdev/yopedia checkout at e38148581c31ac92dc11aa11108532bfb90474f2. The task/environment should install the repo’s JavaScript dependencies using the repo’s detected lockfile/package manager, then run verification from the repository root. The task should not require network services, databases, or app runtime setup beyond dependency installation for ESLint.

Verifier plan: test_outputs.py should assert eslint.config.mjs still imports FlatCompat, still extends next/core-web-vitals and next/typescript, and still ignores node_modules/, .next/, .open-next/, out/, build/, next-env.d.ts, and workers/. It should then verify the @typescript-eslint/no-unused-vars rule remains warn-level and its options include argsIgnorePattern: ^, varsIgnorePattern: ^, caughtErrors: all, caughtErrorsIgnorePattern: ^, destructuredArrayIgnorePattern: ^, and ignoreRestSiblings: true. Finally, it should create a temporary TypeScript fixture and run ESLint against it, expecting no warning for underscore-prefixed unused parameters, caught errors, and destructured array placeholders, while still producing warnings for equivalent unprefixed unused bindings.

Oracle plan: The oracle solution edits eslint.config.mjs only, adding the missing @typescript-eslint/no-unused-vars options to the existing rule object without changing the FlatCompat setup, Next.js extends, export format, or existing ignore globs.

Difficulty plan: Current coding assistants may over-edit by replacing the flat config, changing the rule severity to error, removing Next.js compatibility setup, or assuming varsIgnorePattern covers all binding kinds. They may also forget that caught errors require caughtErrors: all before caughtErrorsIgnorePattern is meaningful.

Repo patch scope: Expected upstream edits are limited to eslint.config.mjs. No application source files, package manifests, lockfiles, or generated build outputs should be changed.

Anti-leakage notes: Do not expose any solver-facing text that mentions benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context; present it as a normal ESLint configuration issue.

Approach: Modify the existing @typescript-eslint/no-unused-vars options object in eslint.config.mjs, preserving argsIgnorePattern and varsIgnorePattern, and add the caught-error, destructured-array, and rest-sibling options needed for a consistent underscore ignore policy.

Verification: Run python test_outputs.py from the repository root; it should inspect eslint.config.mjs and execute ESLint on a temporary TypeScript fixture to confirm the intended warnings and non-warnings.

Risk: The main risk is dependency installation variability for ESLint/Next.js packages; mitigate by making the verifier first perform robust static assertions, then run the behavioral ESLint check only after using the repo’s package manager installation path.

Path rules: task package is tasks/; mutable upstream checkout is tasks//environment/repo; benchmark package files are under tasks//task; verifier/container environment belongs under tasks//task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest.

Agent context

Task slug: underscore-unused-vars-lint
Branch: task/underscore-unused-vars-lint

## Assigned idea Benchmark authoring specification. Summary: Update the repo’s ESLint flat config so the existing underscore convention for unused args and vars also applies deterministically to caught errors, destructured array placeholders, and object rest siblings. Task intent: Make an ordinary upstream-facing ESLint configuration improvement in yopedia: preserve the current Next.js flat config and warning-level @typescript-eslint/no-unused-vars rule, while extending its underscore-ignore convention to common TypeScript patterns that currently are not explicitly covered. Benchmark plan: Construct the task package from the pinned repo commit with instructions focused only on the lint policy change. The solver-facing prompt should ask for a small ESLint configuration update that keeps the existing ignores and Next.js extends intact, and should not mention verifier internals. Include a verifier that checks both static config shape and lint behavior with a temporary TypeScript fixture. Environment plan: The environment/repo is the yologdev/yopedia checkout at e38148581c31ac92dc11aa11108532bfb90474f2. The task/environment should install the repo’s JavaScript dependencies using the repo’s detected lockfile/package manager, then run verification from the repository root. The task should not require network services, databases, or app runtime setup beyond dependency installation for ESLint. Verifier plan: test_outputs.py should assert eslint.config.mjs still imports FlatCompat, still extends next/core-web-vitals and next/typescript, and still ignores node_modules/**, .next/**, .open-next/**, out/**, build/**, next-env.d.ts, and workers/**. It should then verify the @typescript-eslint/no-unused-vars rule remains warn-level and its options include argsIgnorePattern: ^_, varsIgnorePattern: ^_, caughtErrors: all, caughtErrorsIgnorePattern: ^_, destructuredArrayIgnorePattern: ^_, and ignoreRestSiblings: true. Finally, it should create a temporary TypeScript fixture and run ESLint against it, expecting no warning for underscore-prefixed unused parameters, caught errors, and destructured array placeholders, while still producing warnings for equivalent unprefixed unused bindings. Oracle plan: The oracle solution edits eslint.config.mjs only, adding the missing @typescript-eslint/no-unused-vars options to the existing rule object without changing the FlatCompat setup, Next.js extends, export format, or existing ignore globs. Difficulty plan: Current coding assistants may over-edit by replacing the flat config, changing the rule severity to error, removing Next.js compatibility setup, or assuming varsIgnorePattern covers all binding kinds. They may also forget that caught errors require caughtErrors: all before caughtErrorsIgnorePattern is meaningful. Repo patch scope: Expected upstream edits are limited to eslint.config.mjs. No application source files, package manifests, lockfiles, or generated build outputs should be changed. Anti-leakage notes: Do not expose any solver-facing text that mentions benchmark, harness, Snorkel, Harbor, std-ts, agent, stage, attempt, retry, generated task, or evaluation context; present it as a normal ESLint configuration issue. Approach: Modify the existing @typescript-eslint/no-unused-vars options object in eslint.config.mjs, preserving argsIgnorePattern and varsIgnorePattern, and add the caught-error, destructured-array, and rest-sibling options needed for a consistent underscore ignore policy. Verification: Run python test_outputs.py from the repository root; it should inspect eslint.config.mjs and execute ESLint on a temporary TypeScript fixture to confirm the intended warnings and non-warnings. Risk: The main risk is dependency installation variability for ESLint/Next.js packages; mitigate by making the verifier first perform robust static assertions, then run the behavioral ESLint check only after using the repo’s package manager installation path. Path rules: task package is tasks/<slug>; mutable upstream checkout is tasks/<slug>/environment/repo; benchmark package files are under tasks/<slug>/task; verifier/container environment belongs under tasks/<slug>/task/environment; regular and UI verifier logic belongs in task/tests/test_outputs.py and test.sh only runs that file through pytest. ## Agent context Task slug: underscore-unused-vars-lint Branch: task/underscore-unused-vars-lint <!-- std-ts:idea-pr-body -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task/underscore-unused-vars-lint:task/underscore-unused-vars-lint
git switch task/underscore-unused-vars-lint

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff task/underscore-unused-vars-lint
git switch task/underscore-unused-vars-lint
git rebase main
git switch main
git merge --ff-only task/underscore-unused-vars-lint
git switch task/underscore-unused-vars-lint
git rebase main
git switch main
git merge --no-ff task/underscore-unused-vars-lint
git switch main
git merge --squash task/underscore-unused-vars-lint
git switch main
git merge --ff-only task/underscore-unused-vars-lint
git switch main
git merge task/underscore-unused-vars-lint
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snorkel/root-repository-maintenance-22aa0ee7b8fc4e!4
No description provided.