Closed
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have read the FAQ and my problem is not listed.
Repro
{
"rules": {
"@typescript-eslint/switch-exhaustiveness-check": "warn"
}
}
enum SomeKind {
Kind1,
Kind2,
Kind3,
Kind4,
}
const foo: SomeKind = determineKind();
// Kind1 and Kind3 need some extra logic for whatever reason
switch (foo) {
case SomeKind.Kind1:
// some special logic for this kind
break;
case SomeKind.Kind3:
// some special logic for this kind
break;
/* no default */
}
Expected Result
Similar to the core ESLint rule default-case
, I would expect the linter to see that I have explicitly stated that no more cases are needed.
Actual Result
I get a warning that the switch/case doesn't cover the full enum.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.3.0 |
@typescript-eslint/parser |
4.3.0 |
TypeScript |
4.0.3 |
ESLint |
7.10.0 |
node |
14.13.0 |