reconsider the defaults of eslint config
See original GitHub issuethings has changed since eslint was created in 2013. It is time to reconsider the defaults of eslint config. I would suggest the changes:
- sourceType: “script” => “module”
- native esm has been supported by latest modern browsers and node.js
- a large number of devs are writing esm, and using something like babel/ts to support older browser/node.js versions.
-
ecmaVersion: 5 => “latest” we have often got issues like “unexpected token…” just because not config
ecmaVersion
. e.g. https://github.com/eslint/eslint/issues/11643 the change should be good for users & maintainers. -
–ext: “.js” => “.js,.mjs,.cjs”
it is a breaking change, but it’s very easy to restore the old behaviour
{
"parserOptions": {"ecmaVersion": 5, "sourceType": "script",}
}
if we agreed to the change, document & eslint --init
should be updated to reflect the change, too.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Configuration Files - ESLint - Pluggable JavaScript Linter
By default, ESLint looks for configuration files in all parent folders up to the root directory.
Read more >eslint-config-defaults - npm
eslint -config-defaults. A composable set of ESLint configurations. Installation. Install this config package and ESLint:.
Read more >Understanding ESLint Configuration - DEV Community
By default, ESLint uses a parser called "Espree", but you can use a different one by specifying it in the parser field of...
Read more >Configuring ESLint - ESLint - Pluggable JavaScript linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >vue/cli-plugin-eslint
If you want to follow ESLint's default behavior instead, consider adding a .eslintignore file in your project. Configuration #. ESLint can be ...
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 FreeTop 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
Top GitHub Comments
I’ll handle this as I’m working on the new config.
Fixed in #15185