8000 Bug: [no-unused-expressions] expression with type arguments is not flagged · Issue #7748 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

Bug: [no-unused-expressions] expression with type arguments is not flagged #7748

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

Closed
4 tasks done
bradzacher opened this issue Oct 14, 2023 · 0 comments · Fixed by #7831
Closed
4 tasks done

Bug: [no-unused-expressions] expression with type arguments is not flagged #7748

bradzacher opened this issue Oct 14, 2023 · 0 comments · Fixed by #7831
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@bradzacher
Copy link
Member

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.0.4&fileType=.tsx&code=MYGwhgzhAEBiD28A8AVAfNA3tAvgWAChCB6Y6CAC3gFcQATaAIwFNoBbMAJwGtmHJo1AHbUIfQgmQQALpwCWQgOZpChAIwBuQkA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tidmUQAm9AB7FoKZJQ5NUGSImjQO0SODABfEOqA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

class Foo<T> { }

// should be marked as unused
Foo<string>

ESLint Config

module.exports = {
  "rules": {
    "@typescript-eslint/no-unused-expressions": "error"
  }
}

tsconfig

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

Expected Result

Expected 1 error as the expression-with-type-arguments is a pure expression.

Actual Result

No errors.

Additional Info

No response

@bradzacher bradzacher added bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin accepting prs Go ahead, send a pull request that resolves this issue labels Oct 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
1 participant
0