question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reconsider the defaults of eslint config

See original GitHub issue

things has changed since eslint was created in 2013. It is time to reconsider the defaults of eslint config. I would suggest the changes:

  1. 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.
  1. 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.

  2. –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:closed
  • Created 2 years ago
  • Reactions:13
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Oct 16, 2021

I’ll handle this as I’m working on the new config.

0reactions
nzakascommented, Jan 12, 2022

Fixed in #15185

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found