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/return-await": "error"
}
}
function test<T>(): Promise<T> {
const res = await fetch("...");
try {
return res.json() as Promise<T>;
} catch (err) {
throw new Error("Request Failed.");
}
}
Expected Result
Fix result: return await (res.json() as Promise<T>);
Actual Result
Fix result: return await res.json() as Promise<T>;
This "fixed" code triggers the same lint error, and ESLint runs the fix multiple times, resulting in return await await ... await await res.json() as Promise<T>;
.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.28.2 |
@typescript-eslint/parser |
4.28.2 |
TypeScript |
4.3.5 |
ESLint |
7.30.0 |
node |
15.9.0 |