Allow setting ecmaVersion to latest
See original GitHub issueWhat version are you using? 3.9.1
Problem I want to solve I want to be able to always use the latest available ecmaVersion
Proposed solution
Allow 'latest'
as a config option for ecmaVersion
, aliasing whatever the latest version the included acorn supports. Kinda like https://babeljs.io/docs/plugins/preset-latest/
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:33 (33 by maintainers)
Top Results From Across the Web
Language Options - ESLint - Pluggable JavaScript Linter
ESLint lets you configure language options specific to the JavaScript used in ... 2016 globals and automatically sets the ecmaVersion parser option to...
Read more >Specifying Environments in ESLint Configurations [duplicate]
An environment provides predefined global variables. The available environments are: es6 - enable all ECMAScript 6 features except for modules ( ...
Read more >acorn - npm
Defaults to true for ecmaVersion 2022 and later, false for lower versions. Setting this option to true allows to have top-level await ...
Read more >JSHint Options Reference
This option allows you to force all variable names to use either ... The option cannot be maintained without automatically opting users in...
Read more >Configuring ESLint - ESLint - Pluggable JavaScript linter
ESLint allows you to specify the JavaScript language options you want to ... ecmaVersion - set to 3, 5 (default), 6, 7, or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ilyavolodin I always want the latest syntax. Browsers have versionless JS. I don’t see why ESLint shouldn’t at least have the ability to opt into such. IMHO
latest
should have been the default.Micro-optimization to you, better UX for many others. Easiest solution would just be to hard-code a list of supported ECMAScript versions. It only needs updating once a year and then you’re in control of what
latest
means for ESLint.1 second * ESLint users * configs, adds up.
I’m still very much against tying this to Espree’s release cycle, even with a disclaimer, for a few reasons:
ecmaVersion
and when ESLint fully supports the new features, because rules need to be updated for the new syntax. This means that there’s a very high probability that ESLint is broken for those users for that duration. Example: see the following changes that had to be made to ensureasync
/await
worked for all of ESLint’s core rules. You could argue that the user doesn’t have to use the new features - but then what’s the point of the option? I’m not a fan of knowingly giving users an option that has a high probability of breaking their build.latest
to Espree’s release cycle means that two users (or even two builds by the same person) running the same version of ESLint could potentially have been linted with the parser set to two differentecmaVersion
s. How can one have confidence in a quality assurance check if it’s not deterministic?The “eslint:all” configuration is different because it only changes on new releases of ESLint. To be clear: I’m not against the inclusion of this option, but I do think it should be tied to ESLint’s release cycle.