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-const-enums: why are exports ignored? #67
Comments
I'm guessing it's because library depending on the exported member will not be able to see the enum. In my case I have no enums exported in my public API and would prefer const enums, an option would be good here imo. |
Exported enums may be used outside of the library in a dynamic way that is not supported with const enums. That could be configured by introducing a new configuration option. But unfortunately there is another design limitation. The rule only processes one file at a time. That means it won't find dynamic uses of the enum in other files of your library. I guess this is doable if type information is available. I'll look into this for one of the next releases. |
Hello! Thank you for this great module. However, I've installed this module only for Are you planning to enable support for this use case? Thanks! |
+1 also would like to see this |
In https://github.com/ajafff/tslint-consistent-codestyle/blob/master/docs/prefer-const-enum.md, not sure why this restriction is in place?
The text was updated successfully, but these errors were encountered: