no-case-declarations
Configuration
rslint.config.ts
Rule Details
Disallow lexical declarations in case clauses. Lexical declarations (let, const, function, class) in case clauses are visible in the entire switch block but only get initialized when assigned, which can lead to unexpected behavior.
Examples of incorrect code for this rule:
Examples of correct code for this rule: