Repository navigation
Use ESLint's default parser in the ESLint config - #3123
Merged
Merged
Conversation
@babel/eslint-parser 8 requires ESLint 9+, while the projects are still on ESLint 8 with the legacy .eslintrc.js config, and @babel/eslint-parser 7 requires @babel/core 7. So projects upgrading to Webpack Encore 7 (which requires Babel 8) can no longer use it. The JS code only uses standard syntax, so ESLint's default parser is enough when the ECMAScript version is set to latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The
.eslintrc.jstemplate still uses@babel/eslint-parser, which can't be installed anymore by the projects upgraded to@symfony/webpack-encore7 (which requires Babel 8):@babel/eslint-parser8 requires ESLint 9+, but the projects are still on ESLint 8 with the legacy.eslintrc.jsconfig.@babel/eslint-parser7 requires@babel/core7.These projects therefore dropped it and switched to ESLint's default parser with
ecmaVersion: 'latest', but the DevKit PRs revert that, and the "Webpack Encore" job then fails withCannot find module '@babel/eslint-parser':This changes the template to that same config, so it no longer conflicts with these branches.
The branches still on Babel 7 (SonataAdminBundle 5.x, SonataPageBundle 5.x, form-extensions 3.x) only use standard syntax:
npx eslint --max-warnings 0 assets/jspasses on all three with the new config. They can drop@babel/eslint-parserfrom theirpackage.jsonafterwards, but it's harmless to keep until then.🤖 Generated with Claude Code