microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 35 forks source link

1.2.0 - Cannot read tslint configuration - 'linterConfiguration.rules.delete is not a function' #109

Closed FatalMerlin closed 4 years ago

FatalMerlin commented 5 years ago

Steps to Reproduce:

  1. Create new Microsoft SPFx 2016 onPrem solution (yo @microsoft/sharepoint)
  2. Remove invalid extends configuration from tslint.json (Line 2)
  3. Open .ts-file
  4. Check VSCode Problems Output:

image

FatalMerlin commented 5 years ago

Nvm, I just realized that Google mislead me to the deprecated repo, sorry

beporter commented 4 years ago

But...where's the issue in the new repo? What's the fix? 😭

EDIT: tsc v3.4.1, tslint v4.5.1

IGx89 commented 4 years ago

Running into this error myself as well... (typescript 2.9.2, tslint 4.5.1)

IGx89 commented 4 years ago

Fix for me was clicking the typescript version box on the bottom right of the toolbar and changing it from "Use VS Code's Version (3.5.2)" to "Use Workspace Version (2.9.2)"

beporter commented 4 years ago

Fix for me was clicking the typescript version box on the bottom right of the toolbar and changing it from "Use VS Code's Version (3.5.2)" to "Use Workspace Version (2.9.2)"

In my case I actually tried that already. And tried completely restarting VSCode itself-- no change from either.

egamma commented 4 years ago

Transferred the issue to the new typescript tslint plugin and reopened it.

YevhenDiachenko0 commented 4 years ago

For me helped to disable eslint vs code extension. Don't exactly know how it was connected

mjbvz commented 4 years ago

@FatalMerlin Were you using this extension or the deprecated one?

FatalMerlin commented 4 years ago

@mjbvz sorry for the late reply!

I was using this extension.

The problem was that the generated solution uses an outdated version of tslint, once I forced that to a current version with yarn everything worked as intended.

The extension didn't use the global tslint installation.

So, to everyone reading this, make sure that your projects tslint version is up-to-date. And sorry for keeping the solution to myself, I didn't realize that more people had the problem, I thought I was being stupid.

Shouldn't the extension use the global (or ideally the most up-to-date) version of tslint that is installed?

mjbvz commented 4 years ago

Thanks for the explanation.

We prefer the tslint version from the current workspace if it is available. I feel this is generally the expected behavior

Let me know if you have any ideas on we could improve debugging errors like this

FatalMerlin commented 4 years ago

One possibility would be to include the path to the used tslint installation and is version.

But why do you prefer the workspace version? The extension is not tied to the open protect as, while I might be using it, another user might use a different editor without the plug-in or as in this case this might be based on a autogenerated template.

Can you maybe make the tslint version selectable? (Built-in, workspace, global?)

eslint and jshint are also looking for the packages globally as far as I know.