Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
eamodio opened this issue Aug 23, 2020 · 0 comments · Fixed by #2330 or #2420
Closed
3 tasks done
Assignees
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin scope analyser Issues that are caused by bugs/incomplete cases in the scope analyser

Comments

@eamodio
Copy link

eamodio commented Aug 23, 2020

  • 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
@eamodio eamodio added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Aug 23, 2020
@bradzacher bradzacher added bug Something isn't working scope analyser Issues that are caused by bugs/incomplete cases in the scope analyser and removed triage Waiting for maintainers to take a look labels Aug 23, 2020
@bradzacher bradzacher self-assigned this Aug 23, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin scope analyser Issues that are caused by bugs/incomplete cases in the scope analyser
Projects
None yet
2 participants