Suggestion: standardize against prefixing rule names with "no-" #6022
Replies: 16 comments 4 replies
-
Changing names of rules is considered breaking change and can be done only in major release I don't disagree that some of rules should not be prefixed with |
Beta Was this translation helpful? Give feedback.
-
How about rule aliases? As in, having a Just to clarify: for rules that aren't yet ported, would removing the |
Beta Was this translation helpful? Give feedback.
-
eslint provides api for deprecation and replacing rules
https://eslint.org/docs/developer-guide/working-with-rules#rule-basics |
Beta Was this translation helpful? Give feedback.
-
I don't have "final" answer for you now about usage of prefix. my opinion is that we should follow eslint rule naming convention https://eslint.org/docs/developer-guide/working-with-rules#rule-naming-conventions
@typescript-eslint/core-team what is your opinion on this? |
Beta Was this translation helpful? Give feedback.
-
Yeah we need to knuckle out some guidance around this. Most of our Now that we are much bigger, we should definitely nut out some guidance docs around this. We can deprecate and redirect users to new rules to replace some of the |
Beta Was this translation helpful? Give feedback.
-
Note also that you can't just rename the rule from Not saying it wouldn't be a good change, it's just not simple to do, and can't really be done with aliases unless there is some refactoring done. |
Beta Was this translation helpful? Give feedback.
-
Just I mention about the deprecation policy in ESLint core.
Related references: |
Beta Was this translation helpful? Give feedback.
-
Should we do a 2.0 and get rid of all the |
Beta Was this translation helpful? Give feedback.
-
A number of the Going through the list (checkmark = imo should be renamed):
|
Beta Was this translation helpful? Give feedback.
-
i don't see point in rules like:
it's better to keep rules simple |
Beta Was this translation helpful? Give feedback.
-
the problem with two rules is now you can have a state where you're both not allowed to use interfaces and not allowed to use type aliases. we can have a rule |
Beta Was this translation helpful? Give feedback.
-
Regarding the change to add options to |
Beta Was this translation helpful? Give feedback.
-
Marking as accepting breaking change PRs per the list in #203 (comment). |
Beta Was this translation helpful? Give feedback.
-
would like to add that some "no-" rules' names don't lend themselves well to understanding; for example, "no-inferrable-types" can (and has multiple times on my team) give the impression that it does the opposite of what it does. It has been floated that "force-type-inference" would be a good disambiguation. |
Beta Was this translation helpful? Give feedback.
-
Can we at least keep the |
Beta Was this translation helpful? Give feedback.
-
For the
For |
Beta Was this translation helpful? Give feedback.
-
Many ESLint and TSLint rules start with "no-" to indicate a preference against some behavior. Some behaviors are always bad (e.g.
no-eval
), but others eventually are requested to have a preference towards. Having "no-" starting the rule name then makes it weird to add an option to encourage the behavior. For example:no-parameter-properties
] Support enforcing the inverseno-type-alias
]: Support enforcing the inverseHaving only some rules start with
no-
also makes them a little less discoverable. There are a few more characters to scan through, and alphabetical lists make a little less sense.Since it's already a conversion to go from TSLint to ESLint, can there be a preference set for not starting rule names with "no-"? In the two cases above, it'd be better if they were
parameter-properties
andtype-alias
.Beta Was this translation helpful? Give feedback.
All reactions