Skip to content

[no-unused-var] false positive when using recursive interface in d.ts #2714

Closed
@lakerswgq

Description

@lakerswgq
  • 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"
  }
}

interface.d.ts

// good
interface IPerson {
  name: string;
  age: number;
}
// got warning
interface IItem {
  title: string;
  url: string;
  children?: IItem[];
}

Expected Result

No warning on interface IItem

Actual Result
Got warning: 'IItem' is defined but never used

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.6.0
@typescript-eslint/parser 4.6.0
TypeScript 4.0.5
ESLint 6.8.0
node 12.16.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershas prthere is a PR raised to close thispackage: 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