Skip to content

[no-unused-vars] new v4 false positive: generic type arg used as function parameter list #2449

@mmkal

Description

@mmkal
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/no-unused-vars": [
      "warn",
      { "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
    ]
  }
}
export type F<A extends unknown[]> = (...a: A) => unknown;

Expected Result

No error

Actual Result

Error - 'A' is defined but never used.eslint@typescript-eslint/no-unused-vars

Additional Info

When removing the ... before a, the error is no longer reported (although obviously this is a completely different type - just including this info in case it's helpful). i.e. this is fine:

export type F<A extends unknown[]> = (a: A) => unknown;

Versions

package version
@typescript-eslint/eslint-plugin 4.0.1
@typescript-eslint/parser 4.0.1
TypeScript 4.0.2
ESLint 7.7.0
node 12.17.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy