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

Remove non-recommended rules from recommended config #10873

Closed
platinumazure opened this issue Sep 19, 2018 · 6 comments
Closed

Remove non-recommended rules from recommended config #10873

platinumazure opened this issue Sep 19, 2018 · 6 comments

Comments

@platinumazure
Copy link
Member

@platinumazure platinumazure commented Sep 19, 2018

The version of ESLint you are using.

5.6.0/master

The problem you want to solve.

The eslint:recommended config contains all ESLint rules. Non-recommended rules are explicitly set to "off", while recommended rules are set to "error".

This impacts users who might wish to extend eslint:recommended after having already extended a different configuration. The rules configured as "off" will override any rules configured as "warn" or "error" in the extended configuration.

In practice, this is pretty rare. However, it also seems that eslint:recommended should not explicitly turn off other rules.

Inspired by #10816.

Your take on the correct solution to problem.

Remove the "off" rules from eslint:recommended. This is technically a breaking change, so we should do this within a major release.

@platinumazure
Copy link
Member Author

@platinumazure platinumazure commented Sep 19, 2018

In #10816 (comment), it was noted that the recommended config was originally set up as a template where all of the core rules could be listed.

Rule discoverability has greatly improved since then:

  • The website lists all the core rules and is very searchable
  • In a local repo clone, one could look at lib/rules or docs/rules and see all the core rules there
  • In a Node API context, one could use CLIEngine#getRules or Linter#getRules to get all core rules (if no plugins are loaded)

So I'm hoping that we no longer need to use the eslint:recommended config as a template for seeing all the core rules.

@eslint-deprecated
Copy link

@eslint-deprecated eslint-deprecated bot commented Dec 11, 2018

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@not-an-aardvark not-an-aardvark self-assigned this Jan 16, 2019
@not-an-aardvark
Copy link
Member

@not-an-aardvark not-an-aardvark commented Jan 16, 2019

I'm willing to champion this issue for the next major release.

@not-an-aardvark not-an-aardvark added this to Needs discussion in v6.0.0 Jan 16, 2019
@platinumazure
Copy link
Member Author

@platinumazure platinumazure commented Jan 31, 2019

TSC Summary:

The eslint:recommended config contains all ESLint rules. Non-recommended rules are explicitly set to "off", while recommended rules are set to "error".

This impacts users who might wish to extend eslint:recommended after having already extended a different configuration. The rules configured as "off" will override any rules configured as "warn" or "error" in the extended configuration.

In practice, this is pretty rare. However, it also seems that eslint:recommended should not explicitly turn off other rules.

TSC Question:

Should we remove non-recommended rules from the eslint:recommended config in the next major release?

@btmills
Copy link
Member

@btmills btmills commented Jan 31, 2019

This has been accepted for the next major release!

@not-an-aardvark not-an-aardvark moved this from Needs discussion to Accepted, ready to implement in v6.0.0 Jan 31, 2019
@platinumazure
Copy link
Member Author

@platinumazure platinumazure commented Feb 6, 2019

Working on this.

platinumazure added a commit that referenced this issue Feb 6, 2019
Only explicitly recommended rules will be exported in eslint:recommended configuration.
@not-an-aardvark not-an-aardvark moved this from Accepted, ready to implement to Implemented, pending review in v6.0.0 Feb 14, 2019
@not-an-aardvark not-an-aardvark moved this from Implemented, pending review to Ready to merge in v6.0.0 Feb 14, 2019
v6.0.0 automation moved this from Ready to merge to Done Apr 1, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v6.0.0
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants