rusackas commented on PR #40846:
URL: https://github.com/apache/superset/pull/40846#issuecomment-4655087689

   Picked this one up and pushed a migration commit (`e1c746c`) on top of the 
dependabot bump (rebased on latest master).
   
   ### What the v8→v10 bump actually requires here
   The frontend's primary linter is **oxlint** now — ESLint only survives in 
one spot: `scripts/oxlint-metrics-uploader.js` (run by `npm run lint-stats` in 
`tech-debt.yml`), which lints `src/` with the custom Superset rules + Prettier. 
The full `.eslintrc.js` rule set was already superseded by oxlint and wasn't 
referenced by any command.
   
   ESLint 9/10 breaking changes that bit us:
   - **eslintrc is gone** (no auto-discovery, removed in v10) and the 
`--no-eslintrc` flag is removed → must move to flat config.
   - **`@babel/eslint-parser` doesn't support ESLint v10** (no stable release; 
crashes with `scopeManager.addGlobals is not a function`).
   - **RuleTester is flat-config-only** (`parserOptions` → `languageOptions`, 
and the `type` error matcher is rejected).
   - **Plugin peer deps**: several plugins still cap at `eslint@^9`.
   
   ### What I changed
   - **Migrated the active minimal config** `.eslintrc.minimal.js` → 
`eslint.config.minimal.js` (flat config), swapping the dead babel parser for 
`@typescript-eslint/parser` (the custom rules are pure AST visitors, no type 
info needed).
   - **Updated the uploader command**: dropped `--no-eslintrc`, pointed 
`--config` at the flat config.
   - **Removed dead eslintrc-format files** (`.eslintrc.js`, 
`.eslintrc.minimal.js`, `.eslintignore`) — unsupported by v10 and unreferenced; 
oxlint owns the full rule set.
   - **Ported the custom-rule RuleTester tests** (`eslint-plugin-icons`, 
`eslint-plugin-i18n-strings`) to the flat-config API.
   - **Bumped plugins** to v10-compatible versions: `@typescript-eslint/*` → 
8.61, `eslint-config-prettier` → 10, `eslint-plugin-lodash` → 8, 
`eslint-plugin-react-you-might-not-need-an-effect` → 1. Added `overrides` to 
satisfy v10 peers for the laggards still capped at v9 (`@babel/eslint-parser`, 
`eslint-plugin-import`, `eslint-plugin-jest-dom`).
   
   ### Verification (local)
   - Strict `npm install` resolves to a single deduped `[email protected]`, all 
peers satisfied; lockfile is stable under `--package-lock-only`.
   - The flat config lints all 1808 `src/` files cleanly — only pre-existing 
findings surface (a handful of prettier diffs + one long-standing 
`i18n-strings/no-template-vars` hit), no config/parse errors.
   - Both custom-rule RuleTester tests pass under v10.
   - oxlint (the main lint path) and `scripts/check-custom-rules.js` are 
unaffected; pre-commit (prettier/oxlint/custom-rules/type-check) passes.
   
   ### Remaining / notes
   - ESLint 10 bumps the Node engine to **>=22**; CI frontend already runs Node 
22, so the local `EBADENGINE` warning (I'm on 20) is harmless. Worth a sanity 
check that the CI matrix is on 22 for the `lint-stats` job.
   - The `overrides` are a stopgap until `@babel/eslint-parser`, 
`eslint-plugin-import`, and `eslint-plugin-jest-dom` ship stable v10 peer 
support; they can be dropped then. None of those plugins are used by the config 
that actually runs, so the override is purely to keep the install graph 
resolvable.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to