Skip to content

[no-unused-vars] (v4-alpha.9) Incorrect warning about unused type with abstract field #2417

@eamodio

Description

@eamodio
  • 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",
		{
			"args": "after-used",
			"argsIgnorePattern": "^_",
			"ignoreRestSiblings": true,
			"varsIgnorePattern": "^_$"
		}
	]
  }
}

fileA

export type FooType = 'foo' | 'bar';

fileB

import { FooType } from './fileA';

abstract class Foo {
	protected abstract readonly type: FooType;
}

Expected Result

No errors/warnings

Actual Result

WARNING in fileB.ts:1:8
    @typescript-eslint/no-unused-vars: 'FooType' is defined but never used. Allowed unused vars must match /^_$/u.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 4.0.0-alpha.9
@typescript-eslint/parser 4.0.0-alpha.9
TypeScript 4.0.2
ESLint 7.7.0
node 12.16.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginscope analyserIssues that are caused by bugs/incomplete cases in the scope analyser

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions