tslint-eslint-rules icon indicating copy to clipboard operation
tslint-eslint-rules copied to clipboard

Rule name collision - add ter prefix to rule names

Open jmlopez-rod opened this issue 8 years ago • 5 comments

There is now a name collision with tslint. In this case, although @buzinas made this rule first the tslint rule takes precedence over the rule provided by this project

from tslint

Core rules cannot be overwritten with a custom implementation.

tslint-eslint-rules: https://github.com/buzinas/tslint-eslint-rules/blob/master/src/rules/useIsnanRule.ts

tslint: https://palantir.github.io/tslint/rules/use-isnan/

I haven't used this rule to see if there are any differences but I would prefer to use the one provided by this project over the ones from tslint.

I know the prefix solution might look weird but I think it is easier for people to see where the rule comes from when looking at the configuration. This would also save us from ever having the name collision problem again.

Not sure if I mentioned this before, but tslint has a side project with custom rules and they have a prefix:

https://github.com/palantir/tslint-react/tree/master/src/rules

Renaming the rules would be a breaking change and would require a major version bump. So if @buzinas and others agree with renaming all the project rules to have the prefix ter I'd like to get the remaining open issues done first.

PS. The no-extra-parens rule is coming soon and I will name it ter-no-extra-parens as I have done with all the new rules I have been introducing.

jmlopez-rod avatar Dec 28 '16 15:12 jmlopez-rod

I think it's time to rename all our rules to ter-* and bump the major version.

What do you think, @jmlopez-rod?

buzinas avatar Mar 17 '17 01:03 buzinas

I agree, I'm working towards closing all issues hopefully before the release of tslint 5.0. I think it would be good to bump the major version at the same time as tslint.

jmlopez-rod avatar Mar 17 '17 05:03 jmlopez-rod

Does the useIsNan rule in this repo behave differently than the one distributed by TSlint? Is there some advantage to enabling 2 rules to check the same thing?

ChrisMBarr avatar Mar 17 '17 11:03 ChrisMBarr

In this case the rule may be so simple that we could deprecated it from this project, the point however, is that we may have some collision later on, as we already saw with indent which behaves very different from the one in eslint. Also the prefix is so that we can easily identify the rule as being part of this project and avoid unnecessary confusion. But you have a valid question, should we deprecate the rule for the next major version? Also, you don't have to enable both rules in case we keep it, instead you would be able to choose one implementation.

jmlopez-rod avatar Mar 17 '17 13:03 jmlopez-rod

The useIsNan rule has been removed in v4.1.0. I'm keeping this issue open till i rename the remaining rules to have the ter prefix.

jmlopez-rod avatar May 22 '17 03:05 jmlopez-rod