no-unsafe-enum-comparison
Added in v0.1.4Configuration
rslint.config.ts
Rule Details
Disallow comparing an enum value with a non-enum value.
TypeScript enums are a special type that represent a set of named constants. Comparing enum values against raw literals or values of a different enum type is often a mistake and can lead to subtle bugs, since enums in TypeScript have their own type identity.
Examples of incorrect code for this rule:
Examples of correct code for this rule: