Skip to content

chore(lint): cleanup unused eslint-disable directives#23212

Open
mattKorwel wants to merge 3 commits intomainfrom
fix/lint-cleanup
Open

chore(lint): cleanup unused eslint-disable directives#23212
mattKorwel wants to merge 3 commits intomainfrom
fix/lint-cleanup

Conversation

@mattKorwel
Copy link
Copy Markdown
Collaborator

@mattKorwel mattKorwel commented Mar 20, 2026

Summary

This PR cleans up over 30 unused eslint-disable directives across the codebase. These directives became redundant following the global exclusion of the .gemini/ directory and recursive node_modules (handled in a separate PR).

Details

  • Removed redundant eslint-disable comments for no-restricted-syntax, @typescript-eslint/no-unsafe-type-assertion, and other rules.
  • Ensures the codebase remains clean and that linting rules are actively enforced where intended.

Related Issues

Related to #23210

How to Validate

  1. Switch to this branch.
  2. Run npm run lint. (Note: This may require the ESLint config changes from Bug: ESLint processes nested .gemini/tmp worktrees, causing terminal lockup #23210 or equivalent to be applied to complete without noise).
  3. Verify that no "Unused eslint-disable directive" warnings are reported.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@mattKorwel mattKorwel added the 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. label Mar 20, 2026
@mattKorwel mattKorwel requested review from a team as code owners March 20, 2026 05:55
@mattKorwel mattKorwel added the 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. label Mar 20, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the performance and reliability of the ESLint process by correctly configuring ignore patterns. By preventing the linter from processing irrelevant directories and files, it resolves issues of excessive lint errors, high memory consumption, and terminal lockups. The changes also contribute to cleaner code by removing numerous redundant ESLint disable comments.

Highlights

  • ESLint Configuration Update: The ESLint configuration has been updated to globally ignore the entire .gemini/ directory and all recursive node_modules, preventing linting of temporary worktrees and generated bundles.
  • ESLint Directive Cleanup: Over 30 previously used eslint-disable directives, including no-restricted-syntax and @typescript-eslint/no-unsafe-type-assertion, have been removed as they are no longer needed.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mattKorwel mattKorwel changed the title fix(lint): ignore .gemini directory and cleanup unused directives chore(lint): cleanup unused eslint-disable directives Mar 20, 2026
@mattKorwel mattKorwel enabled auto-merge March 20, 2026 05:58
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

Size Change: -413 B (0%)

Total Size: 26.3 MB

Filename Size Change
./bundle/chunk-23DI7L5V.js 0 B -3.4 kB (removed) 🏆
./bundle/chunk-IV2KUFMZ.js 0 B -1.96 MB (removed) 🏆
./bundle/chunk-RGAW74XF.js 0 B -14.6 MB (removed) 🏆
./bundle/chunk-XN6LIP7Z.js 0 B -3.64 MB (removed) 🏆
./bundle/core-V2XIMZSL.js 0 B -43.4 kB (removed) 🏆
./bundle/devtoolsService-UUX2LQ3U.js 0 B -27.7 kB (removed) 🏆
./bundle/gemini-O3YTTRVA.js 0 B -521 kB (removed) 🏆
./bundle/interactiveCli-R244XGXP.js 0 B -1.62 MB (removed) 🏆
./bundle/oauth2-provider-PTOK7KZE.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-7BQ72RKF.js 3.64 MB +3.64 MB (new file) 🆕
./bundle/chunk-BCWLDJ7S.js 14.6 MB +14.6 MB (new file) 🆕
./bundle/chunk-Q3HX6JP5.js 3.4 kB +3.4 kB (new file) 🆕
./bundle/chunk-VZCMHNGF.js 1.96 MB +1.96 MB (new file) 🆕
./bundle/core-YW5ZQYBR.js 43.4 kB +43.4 kB (new file) 🆕
./bundle/devtoolsService-BOX3UBFR.js 27.7 kB +27.7 kB (new file) 🆕
./bundle/gemini-LED5Q426.js 521 kB +521 kB (new file) 🆕
./bundle/interactiveCli-JDIEYW4I.js 1.62 MB +1.62 MB (new file) 🆕
./bundle/oauth2-provider-IDOBA26R.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/cleanup-R4BVQ3OU.js 0 B -856 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/gemini.js 2.06 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-CXSTQXLK.js 0 B -922 B (removed) 🏆
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-AM2IFHYU.js 856 B +856 B (new file) 🆕
./bundle/memoryDiscovery-Y4MHQE3F.js 922 B +922 B (new file) 🆕

compressed-size-action

Copy link
Copy Markdown
Contributor

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

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 correctly updates the ESLint configuration to ignore the .gemini/ directory and nested node_modules directories, which should resolve the described performance and linting issues. The associated cleanup of eslint-disable directives in test utility files is also appropriate, as those files are correctly excluded from the stricter type-aware linting rules.

However, I've raised a concern regarding the removal of no-restricted-syntax directives in several product source files. The corresponding lint rule appears to still be active, which could cause the build to fail. Please see the specific comment for more details.

Note: Security Review is unavailable for this PR.

Comment on lines 883 to 884
typeof part.data['callId'] !== 'string' ||
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.

high

This PR removes several eslint-disable-next-line no-restricted-syntax directives across multiple files (e.g., this file, packages/core/src/tools/mcp-tool.ts, etc.). While the cleanup is appreciated, the lint rule that flags the typeof obj['prop'] pattern appears to still be active for product source code in eslint.config.js.

The rule is defined with the selector UnaryExpression[operator="typeof"] > MemberExpression[computed=true][property.type="Literal"], which matches code patterns like typeof part.data['callId'] !== 'string'.

Removing these directives might cause the linter to fail. Could you please double-check that the linter passes with these directives removed? It's possible I'm missing a configuration detail, but based on the provided files, this seems like it would cause an error.

@gemini-cli gemini-cli bot added the area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt label Mar 20, 2026
} else if (responseObj && typeof responseObj === 'object') {
if (
'output' in responseObj &&
// eslint-disable-next-line no-restricted-syntax
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@alisa-alisa any idea what's going on here? I thought we re-enabled this rule.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mattKorwel for context I introduced a linter to ban this type of syntax because it leads to confusing and verbose code with no explicit typings. In some cases we've had bugs creep in where the ad hoc type assertions got out of sync: #21485

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe this can go in? #22902

# Conflicts:
#	packages/core/src/test-utils/mock-message-bus.ts
#	packages/core/src/tools/mcp-tool.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants