Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-unused-variable doesn't properly handle "declare" vars #190

Closed
derekcicerone-zz opened this issue Aug 11, 2014 · 6 comments · Fixed by #398
Closed

no-unused-variable doesn't properly handle "declare" vars #190

derekcicerone-zz opened this issue Aug 11, 2014 · 6 comments · Fixed by #398
Assignees

Comments

@derekcicerone-zz
Copy link
Contributor

For example, this should not be flagged as unused:

declare var assert: chai.Assert;
@filipstachura
Copy link

+1

1 similar comment
@marekrogala
Copy link

+1

@filipstachura
Copy link

any updates here?

@ashwinr
Copy link
Contributor

ashwinr commented Apr 29, 2015

we'll take a look at it as part of the 1.5 migration, should be straightforward.

@adidahiya
Copy link
Contributor

It feels a little weird to me to not use a declared variable; I could see a case for this being an optional part of the no-unused-variable rule.

Is this because you're declaring a variable in one source file and using it in another? Or are you running tslint on your typings files? In the latter case, we'd advise only running tslint on source code.

@filipstachura
Copy link

We declare in one file and then reference it in others. That way when we refactor the name of injected global compilation fails in all files that were not updated.

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

Successfully merging a pull request may close this issue.

6 participants