-
Notifications
You must be signed in to change notification settings - Fork 885
no-unused-variable rule crashes on ES6 bare imports #451
Comments
which version of tslint are you using? |
I'm using 2.2.0-beta, then i tried with 2.3.0-beta but I got same result. |
Can you post the full error output? That looks similar to an error that was fixed in 2.3.0-beta when adding support for TS 1.5 syntax. |
@adidahiya of course, this is the output : |
What is the minimal amount of TS code for which this error occurs? I need some more help to reproduce this bug. |
I find the problem, this code cause that error : import 'jquery';
import 'signalR';
import 'angular';
//... This file is name libs.ts and I use it with browserify to bundle all my vendor libs in one package. |
Ok, thanks for sharing the code. There must be a bit more info included in the error output... the file where JS is throwing the error should tell you which rule is failing here. Can you try to find that? |
This rule crashe "no-unused-variable". |
Hey @adidahiya, I think I'm having the same issue @felixbillon is seeing, so I'll just post here instead of opening a new issue. tslint.json {
"rules": {
"no-unused-variable": true
}
} sample.ts
The command:
TS 1.5 added the "Bare Import" syntax. I think that tslint just isn't supporting it. |
@NickHeiner thanks for the detailed bug report. I'll update the title of this issue. |
Fixes #451 This affects the following rules: - `no-unused-variable` - `no-use-before-declare` - `whitespace` (it was already handled here, but I added a regression test)
Great! Would you mind publishing to npm so I can pick up the bugfix? |
@NickHeiner yes we're making a release now! |
Hie everyone,
I'm using tslint with grunt-tslint and i got an issue when i run it, since I moved on ES6 external module. I got this message :
Fatal error: Cannot read property 'name' of undefined
Can I get some extra output with special parameter ?
Anyoby have an idea ?
Tslint worked well when i was using internal module with 'module' keyword.
The text was updated successfully, but these errors were encountered: