Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bug: [no-unused-vars] false positive if name is type/value merged and exported #6188

@bradzacher

Description

@bradzacher

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=4.9.3&jsx=true&sourceType=module&showAST=es&code=C4TwDgpgBAZg9nKBeKBvAvgbgFAQB5hwBOwUAxnAHYDOp8iKAFAIZEDmAXLAgJTIB8abFChEIwAK5FKUVmxzpsQA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1tidmUQAmtAG4BDaKgyRE0aB2iRwYAL4hlQA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

type foo = {};
export const foo = (arg: foo) => {
  return arg;
}

ESLint Config

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

tsconfig

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

Expected Result

no error because the type foo is used and the value foo is exported

Actual Result

'foo' is assigned a value but never used. 2:14 - 2:17

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinggood first issueGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions