chore: split eslint ignore react-compiler directives#44686
Conversation
When an ESLint ignore directive raises a `react-compiler/react-compiler` error and it's ignored in the same line, ESlint v9 will incorrectly report it as an unused ignore directive. This has been worked around by moving the ESLint ignore directive for `react-compiler/react-compiler` to a separate line. This kinda makes more sense anyway, since the directive below it is what's causing the error. This helps unblock the ESLint v9 upgrade.
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (2 files, +24 -12)
✅ @MetaMask/confirmations (1 files, +2 -1)
|
Builds ready [2aab092]
⚡ Performance Benchmarks (Total: 🟢 12 pass · 🟡 9 warn · 🔴 3 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [2aab092]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 15 warn · 🔴 1 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
|
Builds ready [2aab092]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 13 warn · 🔴 0 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
|
Force-merged to bypass codeowner requirements, unnecessary for a change just to remove obsolete comments |



Description
When an ESLint ignore directive raises a
react-compiler/react-compilererror and it's ignored in the same line, ESlint v9 will incorrectly report it as an unused ignore directive.This has been worked around by moving the ESLint ignore directive for
react-compiler/react-compilerto a separate line. This kinda makes more sense anyway, since the directive below it is what's causing the error.This helps unblock the ESLint v9 upgrade.
Changelog
CHANGELOG entry: null
Related issues
N/A
Manual testing steps
The CI lint step should be sufficient to test that this change has not broken anything.
The ESLint v9 upgrade PR will be the final test of whether all such errors have been avoided. This has been tested to work on a working branch for the update, which you can see here for reference: https://github.com/MetaMask/metamask-extension/compare/main...update-eslint-v9?w=1
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Comment-only ESLint directive formatting with no logic or dependency-array changes.
Overview
Splits combined
eslint-disable-next-linecomments soreact-compiler/react-compilersits on its own line, withreact-hooks/exhaustive-deps(orreact-hooks/rules-of-hooks) on the line below.This avoids ESLint v9 treating the react-compiler suppression as an unused ignore when both rules were disabled on one line. Runtime behavior is unchanged—only comment formatting across UI components and hardware-wallet hooks.
Reviewed by Cursor Bugbot for commit 2aab092. Bugbot is set up for automated code reviews on this repo. Configure here.