Skip to content

[AI Improvement] [Task] Turn off @typescript-eslint/no-use-before-define by deleting its .eslintrc.js override - #11466

Open
joehan wants to merge 1 commit into
mainfrom
ai-improve-582886459-task-turn-off-typescript-eslint-no-
Open

joehan wants to merge 1 commit into
mainfrom
ai-improve-582886459-task-turn-off-typescript-eslint-no-

Conversation

@joehan

@joehan joehan commented Nov 6, 2026

Copy link
Copy Markdown
Member

Description

Resolves Buganizer b/582886459 (parent goal b/565072516).

Turns off @typescript-eslint/no-use-before-define by removing its .eslintrc.js overrides instead of keeping "off" entries:

  • Deleted "@typescript-eslint/no-use-before-define": ["warn", { functions: false, typedefs: false }] (and its TODO(bkendall) comment) from the *.ts override in .eslintrc.js.
  • Deleted the now-redundant "@typescript-eslint/no-use-before-define": "off" entry from the *.js override in .eslintrc.js. None of the extended ESLint/TypeScript configs enable @typescript-eslint/no-use-before-define or base no-use-before-define, so deleting both entries disables the rule everywhere.
  • Removed the now-unused // eslint-disable-next-line @typescript-eslint/no-use-before-define comment in src/ensureApiEnabled.ts.

Skipped file: Left the // eslint-disable-next-line @typescript-eslint/no-use-before-define comment in scripts/integration-helpers/cli.ts untouched to avoid a merge conflict with open PR #11120 (which rewrites lines 50–75). Since reportUnusedDisableDirectives is not enabled, leaving it produces no warnings or errors.

(Note for reviewers: if you prefer keeping @typescript-eslint/no-use-before-define enabled for same-scope use-before-define rather than turning it off, setting ["warn", { functions: false, classes: false, variables: false, enums: false, typedefs: false }] also eliminates all 38 existing warnings across the codebase.)

Scenarios Tested

  • ESLint.calculateConfigForFile on src/apiv2.ts, src/apiv2.spec.ts, and scripts/sanitize-lockfile.js: confirmed @typescript-eslint/no-use-before-define and no-use-before-define both evaluate to undefined.
  • npx eslint --config .eslintrc.js --ext .ts,.js . --format json: confirmed 0 errors and 0 @typescript-eslint/no-use-before-define messages across 1,434 files.
  • npm run lint:quiet: passed (ESLint + Prettier).
  • npm run build, npx tsc --noEmit -p tsconfig.json, and npm run test:compile: passed.
  • npx mocha src/ensureApiEnabled.spec.ts: 21 passing.
  • npm run mocha: 5,934 passing, 11 pending (1 unrelated EADDRINUSE on port 52672 in src/apiv2.spec.ts "with a proxy" hook from concurrent test runs on the shared host).

Sample Commands

N/A (dev-only ESLint configuration change).

@joehan joehan self-assigned this Nov 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the @typescript-eslint/no-use-before-define lint rule from the ESLint configuration and cleans up an obsolete eslint-disable-next-line comment in src/ensureApiEnabled.ts. I have no additional feedback to provide as these changes are straightforward and clean up the codebase.

@joehan
joehan marked this pull request as ready for review November 6, 2026 23:59
@joehan
joehan requested a review from bkendall November 6, 2026 23:59

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant