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

[array-callback-return] False positive when in a map that uses a switch case without default because all possibilities are handled but ESLint isn't aware of that #2841

Closed as not planned
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancement: new base rule extensionNew base rule extension required to handle a TS specific caselocked 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
@MaximeCheramy

Description

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

playground link

The rulearray-callback-return is enabled with default settings. There are no TypeScript equivalent (that's what would fix the issue).

constl=[{type:'a'},{type:'b'}]as{type:'a'|'b'}[]l.map(el=>{switch(el.type){case'a':return'type a'case'b':return'type b'}})
{"compilerOptions": {"declaration":true,"declarationMap":true,"lib": ["dom","es2018","es2018.regexp"    ],"module":"es6","moduleResolution":"node","outDir":"dist","sourceMap":true,"target":"es5","types": ["jest","node"    ]  },"include": ["src/**/*","tests/**/*"  ]}

Versions

packageversion
@typescript-eslint/eslint-plugin4.9.0
@typescript-eslint/parser4.9.0
TypeScript4.1.2
ESLint7.14.0
node12.19.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: new base rule extensionNew base rule extension required to handle a TS specific caselocked 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