Skip to content

fix: ESLint 10 compatibility — drop @babel/eslint-parser, expand peerDeps#45

Open
RoiEf wants to merge 5 commits intopreactjs:masterfrom
RoiEf:master
Open

fix: ESLint 10 compatibility — drop @babel/eslint-parser, expand peerDeps#45
RoiEf wants to merge 5 commits intopreactjs:masterfrom
RoiEf:master

Conversation

@RoiEf
Copy link

@RoiEf RoiEf commented Mar 8, 2026

Fixes #44

Problem

@babel/eslint-parser requires eslint@^7||^8||^9 and crashes on ESLint 10
(scopeManager.addGlobals is not a function) because ESLint 10 ships a new
eslint-scope@9.x API that the Babel parser doesn't support.

Solution

The code already had a TODO to remove the custom parser once class properties
became native — they have been, since ES2022. This PR acts on that TODO:

  • index.js — Drop @babel/eslint-parser and all Babel config. Use
    ESLint's built-in espree parser at ecmaVersion: 'latest', which handles
    class properties natively. Move ecmaVersion/sourceType to the correct
    languageOptions level for flat config.
  • package.json — Remove @babel/core, @babel/eslint-parser,
    @babel/plugin-syntax-class-properties, @babel/plugin-syntax-jsx.
    Extend peerDependencies to ^8.57.1 || ^9.0.0 || ^10.0.0.
  • test/index.test.mjs — Strip volatile fields (nodeType, endLine,
    endColumn) from snapshots so the same snapshot file works under ESLint
    8, 9, and 10.
  • .github/workflows/nodejs.yml — Add ESLint 9 and 10 to the CI matrix.
  • README.md — Note ESLint 10 flat-config requirement and label the
    setup snippet as compatible with ESLint 8, 9, or 10.

Testing

  • All 8 tests pass locally against ESLint 9 (the devDependency version)
  • CI matrix now covers ESLint 8, 9, 10, and local

Fixes #44

Copilot AI and others added 5 commits March 7, 2026 22:13
Co-authored-by: RoiEf <45352222+RoiEf@users.noreply.github.com>
Co-authored-by: RoiEf <45352222+RoiEf@users.noreply.github.com>
Co-authored-by: RoiEf <45352222+RoiEf@users.noreply.github.com>
fix: ESLint 10 compatibility — drop @babel/eslint-parser, expand peerDeps
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.

support eslint version 10

2 participants