Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I haveread the FAQ and my problem is not listed.
Repro
{"rules": {"@typescript-eslint/switch-exhaustiveness-check":"warn" }}
enumSomeKind{Kind1,Kind2,Kind3,Kind4,}constfoo:SomeKind=determineKind();// Kind1 and Kind3 need some extra logic for whatever reasonswitch(foo){caseSomeKind.Kind1:// some special logic for this kindbreak;caseSomeKind.Kind3:// some special logic for this kindbreak;/* no default */}
Expected Result
Similar to the core ESLint ruledefault-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 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin