This repository has been archived by the owner on Apr 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
no-duplicate-string ignore Key-Names #852
Labels
Comments
Indeed, when there is typo in such string (enum element) TypeScript compiler will complain (not very explicitly but still). Even refactoring (renaming) will work for such strings (tested in VSCode). Still in order to introduce this exception to the rule we will need to access type information, to know that object on which string index is accessed is a enum. May be we can simply ignore all strings inside |
If you ignore everything inside |
@marvinside sorry I was not clear, by inside |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to request a feature.
I have all the HTTP Status Codes in an Enum. This maces it easier to reference them and also immediately see what this code means.
The Enum Looks like this:
As you see, there are spaces in the Keys.
So if i reference them, it looks like this:
HTTPStatusCode['Bad Request']
If i use the same Code to often, i'll get the no-duplicate-string warning
Suggested rule-extension:
The text was updated successfully, but these errors were encountered: