Skip to content

[no-unused-vars] Generic type params are covered by varsIgnorePattern rather than argsIgnorePattern #2803

Closed
@jonaskello

Description

@jonaskello
  • 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": ["error", { argsIgnorePattern: "^_" }],
  }
}
// your repro code case

export interface Bar<_A> {
  readonly foo: string;
}

Expected Result

I expected the _A parameter not being used to be ignored becuase it is prefixed with an underscore and therefore part of argsIgnorePattern.

Actual Result

error @typescript-eslint/no-unused-vars : '_A' is defined but never used.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.8.2
@typescript-eslint/parser 4.8.2
TypeScript 4.0.2
ESLint 7.10.0
node 12.18.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions