fix: ESLint 10 compatibility — drop @babel/eslint-parser, expand peerDeps#45
Open
RoiEf wants to merge 5 commits intopreactjs:masterfrom
Open
fix: ESLint 10 compatibility — drop @babel/eslint-parser, expand peerDeps#45RoiEf wants to merge 5 commits intopreactjs:masterfrom
RoiEf wants to merge 5 commits intopreactjs:masterfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #44
Problem
@babel/eslint-parserrequireseslint@^7||^8||^9and crashes on ESLint 10(
scopeManager.addGlobals is not a function) because ESLint 10 ships a neweslint-scope@9.xAPI that the Babel parser doesn't support.Solution
The code already had a
TODOto remove the custom parser once class propertiesbecame native — they have been, since ES2022. This PR acts on that TODO:
index.js— Drop@babel/eslint-parserand all Babel config. UseESLint's built-in espree parser at
ecmaVersion: 'latest', which handlesclass properties natively. Move
ecmaVersion/sourceTypeto the correctlanguageOptionslevel for flat config.package.json— Remove@babel/core,@babel/eslint-parser,@babel/plugin-syntax-class-properties,@babel/plugin-syntax-jsx.Extend
peerDependenciesto^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 ESLint8, 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 thesetup snippet as compatible with ESLint 8, 9, or 10.
Testing
Fixes #44