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.

Remove `meta.docs.category` from core rules

See original GitHub issue

The version of ESLint you are using. master, 7.2.0

The problem you want to solve. https://github.com/eslint/eslint/issues/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
rule name new category
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 not sure, may be P ?
no-restricted-imports same as 🔼 ?
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 not sure
prefer-rest-params B
prefer-spread B
prefer-template B
require-yield B
rest-spread-spacing B
sort-imports S or B
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, to core label should be replaced with rule ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:21 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
anikethsahacommented, Jul 18, 2020

IMO, prefer-destructuring is the best practice because,

  • Less code
  • more code readability.
  • works well for defaults (code quantity is quite less when destructuring)

and about the code you mentioned, the object should have a property a otherwise it would be undefined

eg image image

You can refer the docs or this article for more details

2reactions
nzakascommented, Jul 17, 2020

@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 —fix-type.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Rules - 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 >
Working with Rules - ESLint - Pluggable ... - GitHub Pages
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Manage Drive labels - Google Workspace Admin Help
In the labels manager, find the label you want to delete, and click More "" · Choose Disable. This action isn't available if...
Read more >
Gentle Introduction To ESLint Rules - DEV Community ‍ ‍
type Rule = { meta: { hasSuggestion: boolean; type: "problem" | "suggestion" | "layout"; docs: { description: string; url: string; category: ...
Read more >
Metadata—ArcGIS Online Help | Documentation
Delete deletes any metadata you've added to the item and hides the Metadata button when the item is viewed by others. The Delete...
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