-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Suggestion: standardize against prefixing rule names with "no-" #203
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
Comments
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 |
How about rule aliases? As in, having a Just to clarify: for rules that aren't yet ported, would removing the |
eslint provides api for deprecation and replacing rules
https://eslint.org/docs/developer-guide/working-with-rules#rule-basics |
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? |
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 |
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. |
Just I mention about the deprecation policy in ESLint core.
Related references: |
Should we do a 2.0 and get rid of all the |
A number of the Going through the list (checkmark = imo should be renamed):
|
i don't see point in rules like:
it's better to keep rules simple |
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 |
Regarding the change to add options to |
…gle line (typescript-eslint#203) This PR adds better handling for single line delimiters, and better enforces the `requrieLast` option. Fixes typescript-eslint#92 ## Single line delimiters Previously single line delimiters were either checked or not. This meant that if you used ``` { delimiter: "none", ignoreSingleLine: false, } ``` then the fixer would break your code by removing the delimiter from single line statements i.e.: ```TS interface Foo { bar: string, baz: number } // fixed to this broken line interface Foo { bar: string baz: number } ``` ### Breaking change: - Removed option `ignoreSingleLine` - Added option `singleLine: "none" | "semi" | "comma"` `singleLine` works the same as `delimiter`, except for single line statements only. ## Stricter `requireLast` Previously `requireLast` did nothing when turned off, and enforced having a delimiter when turned on. I felt this was inconsistent with the goals of the linter; being a tool to provide consistent coding conventions. This is the first of two changes to bring the option into line with eslint's [`comma-dangle`](https://eslint.org/docs/rules/comma-dangle#options). (The next change will replace the boolean with an enum; I didn't want to overload this PR). ### Breaking change: - `requireLast: false` now enforces that there is no delimiter on the last member.
Marking as accepting breaking change PRs per the list in #203 (comment). |
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. |
Can we at least keep the |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
.The text was updated successfully, but these errors were encountered: