Skip to content

chore(deps): migrate to ESLint 10 - #42

Merged
lam0819 merged 1 commit into
mainfrom
chore/eslint-10
Nov 26, 2026
Merged

lam0819 merged 1 commit into
mainfrom
chore/eslint-10

Conversation

@lam0819

@lam0819 lam0819 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves lint to ESLint 10 and supersedes #30.

@react-native/eslint-config hasn't caught up with ESLint 10. Its latest release (0.88.1) and the current nightly both still require eslint ^8 || ^9, and on ESLint 10 it fails with scopeManager.addGlobals is not a function. This PR drops the preset and uses its plugins directly in a native flat config.

Changes

  • eslint 9 → 10.15, @eslint/compat 1 → 2, eslint-plugin-prettier 5.5.7 (the bumps from chore(deps-dev): bump the eslint group across 1 directory with 5 updates #30)
  • Removed @react-native/eslint-config, @eslint/eslintrc (FlatCompat) and the now-unused @eslint/js
  • Added the plugins directly: typescript-eslint, eslint-plugin-react, eslint-plugin-react-hooks, eslint-plugin-react-native, @react-native/eslint-plugin, eslint-plugin-jest, @eslint-community/eslint-plugin-eslint-comments, globals
  • eslint.config.mjs: copied in the RN preset's rules, globals and overrides. Left out the rules ESLint core has removed (valid-jsdoc, no-catch-shadow, no-native-reassign, the Node.js rules, and so on), and replaced no-new-object with no-object-constructor. Left out the Flow-only rules and @babel/eslint-parser, since the repo has no Flow sources. The strict TypeScript rules and the test overrides are unchanged.
  • eslint-plugin-react, eslint-plugin-react-native and @react-native/eslint-plugin are wrapped with fixupPluginRules, because they don't declare ESLint 10 support yet.

Test plan

  • yarn lint is clean on ESLint v10.15.0
  • Ran lint on a temporary file with deliberate mistakes. It reported react-hooks/exhaustive-deps, no-var, eqeqeq, no-debugger, react/self-closing-comp and react-native/no-inline-styles, so the ported rules are running.
  • yarn typecheck passes
  • yarn test passes (231 tests)

Drop @react-native/eslint-config (still peers eslint ^8 || ^9 and crashes
with 'scopeManager.addGlobals is not a function') and inline its rule set
into a native flat config using the underlying plugins directly.

Supersedes #30.
@lam0819
lam0819 merged commit 367336b into main Nov 26, 2026
8 checks passed
@lam0819
lam0819 deleted the chore/eslint-10 branch November 26, 2026 10:09
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