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

Suggestion: Make a less intrusive and/or smarter recommended config #353

Open
ragnese opened this issue Oct 13, 2023 · 1 comment
Open

Comments

@ragnese
Copy link

ragnese commented Oct 13, 2023

Right now, extending plugin:node/recommended is "half smart". By that, I mean that it does a bunch of stuff besides just adding rules, but some of those things are a little blunt:

  • It sets parserOptions.ecmaVersion to 2019, which will overwrite ESLint 8's feature of env settings being able to set a default ecmaVersion. In my real-world case, I set env.es2020 = true, which will automatically set parserOptions.ecmaVersion to 11 (aliased as 2020). eslint-plugin-node downgrades my ecmaVersion.
  • It also adds globals. But, setting ESLint's env.node = true also adds globals. I don't know what the overlap is or whether it's redundant.

A simple "fix" to these issues would be to have a "dumb" config that is just the rules used by "plugin:node/recommended" and would require us to manually do the other stuff, like adding to the plugins array.

I know that the plugin can use package.json's engines field for the no-unsupported-features rules. Perhaps it could use it for setting the parserOptions.ecmaVersion as well?

@scagood
Copy link

scagood commented Oct 26, 2023

We're currently maintaining a fork of this plugin over at eslint-plugin-n!

If you have any issues please don't hesitate to make an issue over there :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants