Closed as not planned
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
interface AsyncShow {
show: () => Promise<void>
}
function mockAsyncFn(): AsyncShow {
return {
async show() {
console.log('nop')
return
}
}
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/require-await": "error"
},
};
tsconfig
Expected Result
No error.
Actual Result
Error on show
implementation: Async method 'show' has no 'await' expression.
Additional Info
Since the method just implement an interface (which might be out of scope), it shouldn't require await keyword if it is not necessary for this specific implementation.
The way to fix this is to use Promise.resolve()
inside non-async function, but that's unnecessarily verbose.