Closed
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
{
"rules": {
"@typescript-eslint/no-unsafe-return": "error"
}
}
function foo(): any {
if (Math.random()) {
let res: any = {};
return res;
}
let resArr: any[] = [];
resArr.push(true);
return resArr; // <-- eslint unhappy
}
Expected Result
any
is any and the rule should be happy with anything :-)
Actual Result
error @typescript-eslint/no-unsafe-return : Unsafe return of an any[]
typed value.
Additional Info
Follow up to #3482
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.27.0 |
@typescript-eslint/parser |
4.27.0 |
TypeScript |
4.1 |
ESLint |
7.27.0 |