Closed as not planned
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 |