Skip to content

[no-unused-vars] false positive for imported type alias #363

Closed
@SleeplessByte

Description

@SleeplessByte

Repro

{
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": ["@typescript-eslint"],
  "extends": [
    "plugin:@typescript-eslint/recommended",
    "plugin:react/recommended",
    "prettier",
    "prettier/@typescript-eslint",
    "prettier/babel",
    "prettier/react"
  ],
  "rules": {
    "@typescript-eslint/no-explicit-any": "off",
    "@typescript-eslint/no-parameter-properties": "off",
    "@typescript-eslint/no-unused-vars": ["on", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^ignored?$" }]
  },
}
import { KyInput, KyOptions, unwrap } from 'use-ky'

export function observeKy<T>(input: KyInput, options: KyOptions, unwrap: unwrap<T>): Observable<T> {
  if (input === null) {
    return observableOf<T>()
  }

Expected Result

All good

Actual Result

(alias) type unwrap<T> = (a: ResponsePromise) => Promise<T>
import unwrap

'unwrap' is defined but never used.eslint(@typescript-eslint/no-unused-vars)

Versions

package version
@typescript-eslint/eslint-plugin 1.4.2
@typescript-eslint/parser 1.4.2
TypeScript 3.3.3333
ESLint 5.15.2
node 10.7.0
yarn 1.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thispackage: 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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions