Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ecmaVersion in recommended config is outdated #3085

Open
ClementValot opened this issue Oct 9, 2024 · 6 comments
Open

ecmaVersion in recommended config is outdated #3085

ClementValot opened this issue Oct 9, 2024 · 6 comments

Comments

@ClementValot
Copy link

Config import/recommended has a hardcoded parserOptions.ecmaVersion of 2018

This has the side effect of not being able to parse my eslint.config.mjs which uses nullish coalescing (Unless I override with languageOptions.ecmaVersion = latest )

Is there a technical reason for not setting it to latest (which is currently the ESLint default)?

@michaelfaith
Copy link
Contributor

michaelfaith commented Oct 9, 2024

Good question. When i was doing the flat config work, i was aiming for parity with the original configs, just with the new config structure. And the legacy configs had it defined that way.

parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
},

I can't think of a reason why that shouldn't be 'latest', though.

@ljharb
Copy link
Member

ljharb commented Oct 10, 2024

Changing it would be a breaking change, unfortunately.

@ClementValot
Copy link
Author

I don't know nearly enough about this to understand why, are there features that are enabled with 2018 and wouldn't be with latest?

@ljharb
Copy link
Member

ljharb commented Oct 11, 2024

Because the inability of eslint to tolerate newer syntax is also a feature, and code could accidentally use syntax that isn't actually supported in their target environments if the ecmaVersion is bumped.

@michaelfaith
Copy link
Contributor

michaelfaith commented Oct 11, 2024

Changing it would be a breaking change, unfortunately.

This got me thinking, would there be value in having a checklist of things that we'd like to include whenever there is a need for a new major? I feel like there's been several of these kinds of small items that would be nice to have, but are breaking. Just a thought.

@ljharb
Copy link
Member

ljharb commented Oct 13, 2024

I have various lists tracking them; including a local branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants