-
Notifications
You must be signed in to change notification settings - Fork 14
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
Prefer type literal over interface #4
Comments
Thanks for the suggestion! So if I understand correctly you want to disallow this:
and only allow:
Could you elaborate about the benefits of this? My experience is that type aliases has some drawbacks for error reporting. When you use interface the errors usually include the interface name but for type aliases it prints the whole structure. |
Oh, I think that your point is correct. But is |
I think maybe we need an additional rule called |
Actually I think there are two cases that are not covered:
|
tslint-microsoft-contrib has the opposite of this: |
This will be cool addition to https://github.com/jonaskello/tslint-immutable#no-mixed-interface or as standalone rule I think. Even better to allow functions only in interfaces and data only in type literals
The text was updated successfully, but these errors were encountered: