Skip to content

[@typescript-eslint/no-unused-vars] Typeguard variable marked as unused #1011

Closed
@ambrusadrianzh

Description

@ambrusadrianzh

What code were you trying to parse?

declare type UserId = string // read as a refined type
const isUserId = (s: string): s is UserId => true

What did you expect to happen?
w should not be marked as unused.
What actually happened?
error 'w' is defined but never used @typescript-eslint/no-unused-vars
Versions

package version
@typescript-eslint/eslint-plugin-tslint 2.3.1
@typescript-eslint/parser 2.3.1
TypeScript 3.6.3
ESLint 6.4.0
node 10.15.3
npm 6.11.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thispackage: eslint-plugin-tslintIssues related to @typescript-eslint/eslint-plugin-tslintscope 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