-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Allow ecmaVersion: latest #495
Comments
to clarify: |
No, Acorn supports “latest” so we can pass that directly through from Espree. |
How about making the I'm not sure if ES5 is the most popular environment now. Plus, eslint-plugin-es or something like provides more readable errors instead of "unexpected token" if people want to restrict to an old environment. |
As of now, I don't think we can go that far. maybe we can reconsider it after the "latest" option get landed. |
it could cause potential confusing if the two values are not equal. |
@aladdin-add what problems are you thinking of? The value inside Acorn doesn’t have any effect on ESLint. I think changing the default to latest makes sense. This should not affect ESLint because we are manually setting ecmaVersion in ESLint itself. |
an example: the latest espree's latestEcmaVersion is 2021, but passing |
@aladdin-add Acorn doesn't implement experimental features, so I'm not sure if that's true. Can you give an example where Acorn is supporting something after 2021? |
class fields - it has been supported in acorn v8.2.0, but not for espree yet (#486 has not been merged & released). |
Ah right. Then we should update latestEcmaVersion too before the next Espree release. |
Yes. #486 updates |
Initial implementation here: #499 Note: this issue isn't yet accepted, so I just sent the PR as a draft for now. |
Just to double-check, as it isn't clear from the discussion - we decided to pass Espree's |
If user doesn't specify |
Do we intend to allow specifying A problem with https://github.com/eslint/eslint/blob/master/lib/linter/linter.js#L607-L620 If we pass |
to avoid break eslint, sounds we should explicitly normalize the as for "latest", we have 2 choices:
|
Yes, the idea is to allow "latest" in ESLint configs eventually, but that doesn't have to be done along with this change in Espree. We can always address that later and just make sure that ESLint defaults to The value for I don't think any of this should block enabling "latest" for Espree, though. |
to allow "latest" in ESLint configs, this is not a must. I have made a PR to implement it: eslint/eslint#14622 |
I support both |
As of v8.0.0, Acorn now allows ecmaVersion: latest, which automatically sets ecmaVersion to the latest available version implemented.
Can we also allow this for Espree?
The text was updated successfully, but these errors were encountered: