Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: [no-floating-promises] support TsAsExpression #8692

Open
4 tasks done
arka1002 opened this issue Mar 16, 2024 · 1 comment · May be fixed by #9043
Open
4 tasks done

Bug: [no-floating-promises] support TsAsExpression #8692

arka1002 opened this issue Mar 16, 2024 · 1 comment · May be fixed by #9043
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@arka1002
Copy link
Contributor

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

https://typescript-eslint.io/play/#ts=5.4.2&fileType=.tsx&code=C4TwDgpgBAYg9nKBeKAFATnAtgSwM4QA8AdgK5YBGE6AfFAGRQDeUAFhCAPwBcUew6HMQDmUAL4BuALAAoADYRgUCgEMAXmuRQVeEMQDGUABQBKZHQBM0mao2nteWAglA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oDN4OBDfMwDmtYtA4BbSshTooiaBOiRwYAL4h1QA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

type Foo = Promise<number> & { hey?: string };
let bazz = async () => 2;
bazz() as Foo;

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/no-floating-promises": ["error"],
  },
};

tsconfig

{
  "compilerOptions": {
    "strictNullChecks": true
  }
}

Expected Result

I expected that the 3rd line should report the absence of handling the rejection of the promise.

Actual Result

There was no error on 3rd line

Additional Info

No response

@arka1002 arka1002 added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Mar 16, 2024
@arka1002
Copy link
Contributor Author

Oh! its very similar to #8654

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants