Closed
Description
- [ x ] I have tried restarting my IDE and the issue persists.
- [ x ] I have updated to the latest version of the packages.
- [ x ] I have read the FAQ and my problem is not listed.
Repro
{
"rules": {
"@typescript-eslint/no-misused-promises": ["error"]
}
}
import {expect} from 'chai';
describe('An example', () => {
it('can be an example!', async () => {
expect(await Promise.resolve(true)).to.equal(true);
});
});
tsconfig.json:
{
"compilerOptions": {
"lib": [
"ES2021"
],
"module": "CommonJS",
"moduleResolution": "node"
},
"include": [
"**/*.ts"
]
}
Expected Result
I expect the rule to not throw errors for the 'it' functions of Chai, since it has (this: Context) => PromiseLike<any>
as its signature. No error is thrown for version 5.12.1 and earlier, of @typescript-eslint/eslint-plugin + parser.
Actual Result
<my path>/test.ts
4:28 error Promise returned in function argument where a void return was expected @typescript-eslint/no-misused-promises
✖ 1 problem (1 error, 0 warnings)
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.13.0 |
@typescript-eslint/parser |
5.13.0 |
TypeScript |
4.5.5 |
ESLint |
8.10.0 |
node |
16.13.2 |