-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: new base rule extensionNew base rule extension required to handle a TS specific caseNew 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.Please 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-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 have read the FAQ and my problem is not listed.
Repro
The rule array-callback-return
is enabled with default settings. There are no TypeScript equivalent (that's what would fix the issue).
const l = [{ 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
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.9.0 |
@typescript-eslint/parser |
4.9.0 |
TypeScript |
4.1.2 |
ESLint |
7.14.0 |
node |
12.19.0 |
mastilver, brianvanderwal, omfgitsjack, euphocat, LauSam09 and 21 more
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: new base rule extensionNew base rule extension required to handle a TS specific caseNew 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.Please 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-pluginIssues related to @typescript-eslint/eslint-plugin