Rule proposal: Don't allow literal numbers as values when an enum value 8000 is expected. #4186
Labels
duplicate
This issue or pull request already exists
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Description
What I like about enums:
enum Code { A = 'something else' }
, andCode.A
will then equal the new value1
or above doesn't make sense inenum Code { A }
Except TypeScript allows passing numbers and strings without specifying
Enum.VALUE
. This is confusing and in my opinion defeats the point of an enum.Fail
Pass
The text was updated successfully, but these errors were encountered: