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

[eslint] Allow "latest" as ecmaVersion #13638

Merged
merged 4 commits into from Aug 30, 2021
Merged

Conversation

@fisker
Copy link
Contributor

@fisker fisker commented Aug 5, 2021

Q                       A
Fixed Issues? Closes #13699
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Ref eslint/eslint#14720

@babel-bot
Copy link
Collaborator

@babel-bot babel-bot commented Aug 5, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/48262/

@@ -11,7 +11,7 @@ exports.normalizeESLintConfig = function (options) {

return {
babelOptions: { cwd: process.cwd(), ...babelOptions },
ecmaVersion,
ecmaVersion: ecmaVersion === 'latest' ? 2020 : ecmaVersion,
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo Aug 5, 2021

Does it throw if we just directly pass "latest"?

Copy link
Contributor Author

@fisker fisker Aug 5, 2021

I don't know, I can't find where it's used.

Copy link
Contributor Author

@fisker fisker Aug 5, 2021

Copy link
Member

@fedeci fedeci Aug 7, 2021

eslint-scope does not support 'latest' as valid. Does is make more sense to update it there?

Copy link
Contributor Author

@fisker fisker Aug 19, 2021

eslint-scope suggest handling on parser side. eslint/eslint-scope#74 (comment)

@codesandbox
Copy link

@codesandbox codesandbox bot commented Aug 5, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit fb7cdea:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@@ -11,7 +11,7 @@ exports.normalizeESLintConfig = function (options) {

return {
babelOptions: { cwd: process.cwd(), ...babelOptions },
ecmaVersion,
ecmaVersion: ecmaVersion === "latest" ? 2020 : ecmaVersion,
Copy link
Contributor

@JLHwung JLHwung Aug 18, 2021

The latest is 2022 as of August 2021. I think we can normalize "latest" to 1e8 like acorn did (https://github.com/acornjs/acorn/blob/691a31b1e3d6936f4e6991da3d81c1a6b06610cf/acorn/src/options.js#L109) so we don't have to update it every year.

Copy link
Contributor Author

@fisker fisker Aug 19, 2021

Good idea.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo Aug 30, 2021

See you again in 99997979 years to update this!

Copy link
Contributor Author

@fisker fisker Aug 30, 2021

I won't miss the date.

fedeci
fedeci approved these changes Aug 22, 2021
@nicolo-ribaudo nicolo-ribaudo changed the title Allow "latest" as ecmaVersion [eslint] Allow "latest" as ecmaVersion Aug 30, 2021
@nicolo-ribaudo nicolo-ribaudo merged commit c1f5ca6 into babel:main Aug 30, 2021
26 of 28 checks passed
@fisker fisker deleted the ecma-version-latest branch Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants