Closed
Description
Repro
{
"rules": {
"@typescript-eslint/no-floating-promises": ["error"]
}
}
const demoFunction: (input: boolean) => Promise<string> = (input: boolean) => {
if (input) {
return Promise.resolve('hello world');
} else {
return Promise.reject('input was false');
}
}
// Call 1
demoFunction(true).then(() => {
console.log('Entered then');
}).catch(() => {
console.log('Entered catch');
});
// Call 2
demoFunction(true).then(() => {
console.log('Entered then');
}).catch(() => {
console.log('Entered catch');
}).finally(() => {
console.log('Entered finally');
});
Expected Result
Both Call 1
and Call 2
should pass the floating promises check.
Actual Result
Call 1
passes but Call 2
fails.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.19.2 |
@typescript-eslint/parser |
2.19.2 |
TypeScript |
3.5.3 |
ESLint |
6.8.0 |
node |
12.14.0 |
npm |
6.13.4 |