Skip to content

[no-unused-vars] false positive when a type is used in a generic position on a method in a class with emitDecoratorMetadata: true #2972

@mlc-mlapis

Description

@mlc-mlapis
  • 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.

The problem reported in #2947 has not been solved by #2943. It remains the same as before.

Repro

If AppState is imported:

import {AppState} from '@m-kbase/shared/general/states';

and later used only in a constructor, like:

constructor(
   private _store: Store<AppState>
) {}

then the warning appears in many places (in relation to the import {AppState} from '@m-kbase/shared/general/states'; line):

warning 'AppState' is defined but never used @typescript-eslint/no-unused-vars

Expected Result

The same result as with the previous version 4.13.0 or earlier, with no warnings.

Versions

package version
@typescript-eslint/eslint-plugin 4.14.1
@typescript-eslint/parser 4.14.1
TypeScript 4.1.3
ESLint 7.18.0
node 12.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: 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

      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