Closed
Description
Noticed a lot of false positives for inline arrow functions that were returning non-promise values, yet were failing this rule. touchedFiles
is a string[]
.
Repro
{
"rules": {
"@typescript-eslint/promise-function-async": "warn"
}
}
import path from 'path';
export function someExample() {
['foo', 'bar', 'baz'].some(value => path.basename(value));
}
Expected Result
Inline arrow functions that accept/return primitive values should not fail.
Actual Result
They currently fail.
Additional Info
Doesn't fail when checkArrowFunctions
is false.
TS config:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "preserve",
"lib": [
"dom",
"esnext"
],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"pretty": true,
"removeComments": false,
"strict": true,
"target": "es2018",
"declarationDir": "./lib",
"outDir": "./lib"
},
"include": [
"./src/**/*",
"./types/**/*"
],
"exclude": [
"**/node_modules/*"
]
}
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
1.13.0 |
@typescript-eslint/parser |
1.13.0 |
TypeScript |
3.5.3 |
ESLint |
5.16.0 |
node |
10.14.0 |
npm |
6.5.0 |