Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Similar to my#103 issue.
Theno-type-alias
rule enforcesnot using type aliases, but I would like to enforceuse of type aliases whenever possible. I actually prefer them, and most of the type alias limitations that existed when the original TSLintinterface-over-type-literal
rule was created has since gone away.
I would suggest renaming the rule totype-alias
(without theno-
prefix) and support enforcing bothuse andnon-use of type alias.
Relevant:
- 2019 situation about the differences:https://stackoverflow.com/a/52682220/64949
- TSLint thread about it:interface-over-type-literal shouldn't be recommended palantir/tslint#3248
In short, the only differences are:
- A class cannot implement / extend a type alias that names a union type.
- Declaration merging doesn't work with type aliases.
Personally, I would like to use enforce type aliases whenever possible, which means all the time, except for number1.
. I don't use declaration merging.
I also noticed there's aprefer-interface
rule which seems to overlap with this one. It should probably be merged into this one.