angelozerr / tslint-language-service

TypeScript 2.2.1 plugin for tslint
MIT License
188 stars 22 forks source link

disableNoUnusedVariableRule: false breaks import lookups #72

Closed winston01 closed 6 years ago

winston01 commented 6 years ago

Hi

(I'm not sure if I should open this issue here or in vscode-ts-tslint.)

I recently installed vscode-ts-tslint (v0.0.7) in place of vscode-tslint, and I set "disableNoUnusedVariableRule": false in the tsconfig.json for tslint-language-service. I noticed that in this case the import lookups (including the auto-import) are broken. If I set this rule to true, or remove it from the config, lookups work again.

VSCode version: 1.24.0 (bug was the same with previous version too)

Let me know if you need further details.

UPDATE:

Apparently this happens to modules without type definition. See an example setup in this repo: https://github.com/winston01/vscode-ts-tslint-no-unused-test

Here you can see that for example minimist (w/ a type definition) is recognized correctly, but moment (w/o type def.) is not. If you comment out "disableNoUnusedVariableRule": false in the tsconfig.json and reload the settings, you'll see that moment works too.

winston01 commented 6 years ago

Apparently it's related to this issue pending since a long while:

https://github.com/palantir/tslint/issues/2649

Closed.