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

Allow ecmaVersion to be 'latest'? #74

Closed
fisker opened this issue Aug 8, 2021 · 6 comments
Closed

Allow ecmaVersion to be 'latest'? #74

fisker opened this issue Aug 8, 2021 · 6 comments
Labels
Projects

Comments

@fisker
Copy link

fisker commented Aug 8, 2021

I'm not sure if this make sense to change here, but parsers like @babel/eslint-parser pass ecmaVesion from eslintrc directly to eslint-scope, we need to make change in the parser or eslint-scope to understand 'latest'.

RR in babel codebase babel/babel#13638, review comment

@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Aug 8, 2021
@nzakas
Copy link
Member

nzakas commented Aug 9, 2021

ESLint doesn't pass "latest" around. It is normalized to the latest ecmaVersion.

Honestly, eslint-scope doesn't really need ecmaVersion. The only difference is between 5 and 6+, for let and const. Even then we probably don't need the setting because an ES5 AST won't have let or const.

@nzakas
Copy link
Member

nzakas commented Aug 12, 2021

@fisker any other points I’m missing here?

@fisker
Copy link
Author

fisker commented Aug 13, 2021

ESLint doesn't pass "latest" around.

I think @babel/eslint-parser pass it to eslint-scope, so the real question is should we handle "latest" here or @babel/eslint-parser.

@nzakas
Copy link
Member

nzakas commented Aug 14, 2021

Ah I see. I’d suggest you normalize “latest” to a version number. But as I mentioned, the only thing that matters is 5 vs 6. You can probably just pass 6 all the time.

@fisker
Copy link
Author

fisker commented Aug 19, 2021

Thank you, I'll try to make the change in babel then.

@nzakas
Copy link
Member

nzakas commented Aug 20, 2021

Sounds good.

@nzakas nzakas closed this as completed Aug 20, 2021
Triage automation moved this from Needs Triage to Complete Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

2 participants