Closed
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
async function foo() {
const myPromise = Promise.resolve(true);
const condition = true;
condition && myPromise;
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
},
};
Expected Result
This promise should be marked as floating-promises
or misused-promise
.
// Wrong usage
condition && myPromise;
// Correct usage
condition && await myPromise;
Actual Result
This promise is not marked as floating/misused.
Additional Info
Similar issue was closed: #2544