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

Proposal: 'eslint:all' preset should not include deprecated rules #6734

Closed
mysticatea opened this issue Jul 21, 2016 · 5 comments
Closed

Proposal: 'eslint:all' preset should not include deprecated rules #6734

mysticatea opened this issue Jul 21, 2016 · 5 comments
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint

Comments

@mysticatea
Copy link
Member

mysticatea commented Jul 21, 2016

The version of ESLint you are using:

  • 3.1.1

The problem you want to solve:

We have several accepted issues we will deprecate rules. (#6080, #6586)
We generate eslint:all preset from rule files automatically, and this would include deprecated rules.

I think eslint:all preset should not include deprecated rules.

Your take on the correct solution to problem:

  1. It adds deprecated information into the meta property of rules.
  2. eslint:all checks the meta.deprecated property.
var enabledRules = ruleFiles.reduce(function(result, filename) {
    const ruleId = path.basename(filename, ".js");
    if (path.extname(filename) === ".js" && !rules.get(ruleId).meta.deprecated) {
        result[ruleId] = "error";
    }
    return result;
}, {});
@mysticatea mysticatea added enhancement This change enhances an existing feature of ESLint core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jul 21, 2016
@ilyavolodin
Copy link
Member

Agree!

@platinumazure
Copy link
Member

Agreed: If we have deprecated a rule, the vast majority of the time we already have a preferred replacement available, so rule coverage is not lost. Regarding burden of user having to potentially configure for new rule, that burden is already accepted by the user for completely new rules by using eslint:all. So I definitely think we should make this change.

@nzakas
Copy link
Member

nzakas commented Jul 22, 2016

Agree. We should document this.

@ilyavolodin ilyavolodin added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jul 22, 2016
@alberto
Copy link
Member

alberto commented Jul 22, 2016

Is it ok to exclude it from eslint:all even if it is enabled in eslint:recommended? I guess yes...

@ilyavolodin
Copy link
Member

Yes, because we said right from the start that eslint:all will not be subject to semantic versioning, while eslint:recommended is. So we will remove deprecated rules from eslint:recommended with a next major release, but we can remove them from eslint:all at any time.

@mysticatea mysticatea self-assigned this Jul 25, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

No branches or pull requests

5 participants