Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[switch-exhaustiveness-check] add support for "no default" comment #2631

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
@chimericdream

Description

@chimericdream
  • 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

packageversion
@typescript-eslint/eslint-plugin4.3.0
@typescript-eslint/parser4.3.0
TypeScript4.0.3
ESLint7.10.0
node14.13.0

Metadata

Metadata

Assignees

No one assigned

    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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp