Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

no-unused-vars should understand imported type usage #488

Closed
Snugug opened this issue Jun 18, 2018 · 3 comments
Closed

no-unused-vars should understand imported type usage #488

Snugug opened this issue Jun 18, 2018 · 3 comments

Comments

@Snugug
Copy link

Snugug commented Jun 18, 2018

What version of TypeScript are you using?
2.9.1

What version of typescript-eslint-parser are you using?
16.0.0

What code were you trying to parse?

import { Application } from 'express';

app().then((server:Application) => {

});

What did you expect to happen?
With rule no-unused-vars, I expect Application to come back as being used as it's being imported and used as a type

What happened?
1:10 error 'Application' is defined but never used no-unused-vars

@st-sloth
Copy link

This issue duplicates #457 that is closed because this problem is not a parsing but a rule issue.

@armano2
Copy link
Contributor

armano2 commented Nov 29, 2018

To make it work i suggest using https://github.com/bradzacher/eslint-plugin-typescript/blob/master/docs/rules/no-unused-vars.md

@JamesHenry
Copy link
Member

Using the plugin probably makes the most sense here, ESLint will not be able to understand many TS specific concerns natively.

Please feel free to open any other issues on the new project https://github.com/typescript-eslint/typescript-eslint

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants