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 meta.docs.category
from core rules
#13398
Comments
Previous discussion: #7991 |
Along with |
Can you explain what you mean by this? |
I agree that the ES6 category isn't particularly useful at this point and would love to see those rules categorized by more descriptive categories. |
currently, this issue is labeled with May be some tests might be changed. |
Oh, I see - that makes sense! |
A rule's category is part of its observable metadata, though, no? |
@ljharb Are you asking if this should be a breaking change or not? If so, I agree that we should publish this in a major release. |
Yeah, this would require changes in the |
It would also break any tools in the ecosystem that read the rule's category. |
There are some Would appreciate some inputs/thoughts on them. |
I’d recommend a slight change and suggest we use the rule type instead of categories. The rule types are errors, suggestions, and layout: https://eslint.org/docs/user-guide/command-line-interface#fix-type We can pretty up the headings as Possible Errors, Suggestions, and Code Spacing, or whatever else makes sense. I’d just like us to stick with the three types we already have for simplicity. |
I think it might be good to have more than three categories. For example, |
@mdjermanovic Im not sure that making that distinction is important at this point in ESLint’s lifecycle. I’d like to get away from the term “best practices,” as well, so we can stay a little more neutral. We already have “eslint:recommended” to signify what we believe are the most important rules across the board. Plus, if we stick with using the rule type on the page, this is no longer a breaking change because the meta data isn’t changing. Also, there’s a nice correlation with the use of |
Can someone explain why const { a, b, c, d } = object; But this one is illegible: const { a } = object; Can a linter detect that there's just one variable, and don't enforce the rule? |
IMO,
and about the code you mentioned, You can refer the docs or this article for more details |
As part of this change for ESLint v8.0.0, we also want to remove the |
meta.docs.category
from core rules
chore: rm meta.cat from core rules chore: do not require meta.cat in internal rules chore: rename cat => ruletype
chore: rm meta.cat from core rules chore: do not require meta.cat in internal rules chore: rename cat => ruletype Chore: rename conf/category-list.json => rule-type-list.json chore: update tools/update-rule-types chore: review suggestions Update conf/rule-type-list.json Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Update Makefile.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
) * Breaking: remove category in core rules (fixes #13398) chore: rm meta.cat from core rules chore: do not require meta.cat in internal rules chore: rename cat => ruletype Chore: rename conf/category-list.json => rule-type-list.json chore: update tools/update-rule-types chore: review suggestions Update conf/rule-type-list.json Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Update Makefile.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * chore: remove unused files * fix: conflicts * remove missingMetaDocsDescription message Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>
This will probably create a lot of churn for the Airbnb style guide, since it provides entry points for each category, and groups config by category. |
ESLint 8 changed core rules' category so that we reorder rules. See also eslint/eslint#13398.
The version of ESLint you are using.
master
,7.2.0
The problem you want to solve.
#13382
as discussed, there seems to be some inconsistency among rules that can either belong to es6 category or other categories.
Also as there are other rules as well that support es6+ specs like rest-spread-spacing and others, so I guess it might lead to categories these rules according to their es version.
Your take on the correct solution to problem.
So I guess it would be better to have no category based on es version
Should these are the following ecmascript-6 category rules that should change their category to following new categories
S
:Stylistic Issues
P
:Possible Errors
B
:Best Practices
arrow-body-style
B
arrow-parens
B
arrow-spacing
S
constructor-super
P
generator-star-spacing
S
no-class-assign
P
no-confusing-arrow
B
no-const-assign
P
no-dupe-class-members
P
no-duplicate-imports
P
no-new-symbol
P
no-restricted-exports
P
?no-restricted-imports
no-this-before-super
P
no-useless-computed-key
B
no-useless-constructor
B
no-useless-rename
B
no-var
B
object-shorthand
B
prefer-arrow-callback
P
prefer-const
B
prefer-destructuring
B
prefer-numeric-literals
prefer-rest-params
B
prefer-spread
B
prefer-template
B
require-yield
B
rest-spread-spacing
B
sort-imports
S
orB
symbol-description
B
template-curly-spacing
S
yield-star-spacing
S
thoughts ?
Are you willing to submit a pull request to implement this change?
Yes
PS: I guess I picked the wrong template, it should have been
rule
changes, tocore
label should be replaced withrule
?The text was updated successfully, but these errors were encountered: