Bug: [require-await] fails to infer types for function declarations implementing interfaces #11085
Closed
4 tasks done
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
working as intended
Issues that are closed as they are working as intended
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.8.2&fileType=.tsx&code=PQKgBApgzgNglgOwC5gAJIJ4AdoGMBOcWSAtNPMsPhAI4Cuc1JAhgO7NxIBcYARBPnwB7fLzAhgAKEmIkAgGbNcEMADEhQsAG9JYMPIQ8AFAEowAXgB8YAArCAtnCgQAPADchcACaWA3JIBfaXk6BFwkOCEEMHtmAGsIUx51TR09XCioFHkNZI0LbV09fUMwZigMMLBTC2s04vTMoRgIADoYIQBzIwByAAsIGA6wVhEYLx6TfwaAgBoigOmwaiQ6fGicoX8goA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
The rule believes that the
fn
implementation inside the interface must not beasync
, as it lacks anawait
expression or areturn Promise..
. However, making it notasync
causes the code to fail to compile: it must beasync
according to the types. I believe the purpose of this rule (over the eslint one) is to use this type information to not flag this code as incorrect.Actual Result
Additional Info
No response
The text was updated successfully, but these errors were encountered: