Closed mikeyhew closed 5 years ago
What VS Code version are you using? Did you configure typescript.tsdk
as a user setting?
@mjbvz 1.30.2 on macOS. No, I do not have typescript.tsdk
as a user or workspace setting.
Running that script works for me:
Can you collect the TS server log to see why the tslint plugin is not being loaded:
"typescript.tsserver.log": "verbose",
TypeScript: Open TS Server log
commandtsserver.log
file in itPlease share this log on your empty workspace
@mjbvz I assume you don't want an empty workspace, but the workspace created by the script. Heres is the log output:
Thanks. Are you sure the plugin is installed properly and enabled in that workspace? The Arguments
line at the start of the tsserver log should have a the text --globalPlugins ... tslint
somewhere. Here's mine using VS Code 1.30.2:
Info 0 [15:31:3.653] Starting TS Server
Info 1 [15:31:3.653] Version: 3.2.2
Info 2 [15:31:3.653] Arguments: /Users/matb/Library/Application Support/com.microsoft.VSCode.ShipIt/update.pzrv6qD/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper /Users/matb/Library/Application Support/com.microsoft.VSCode.ShipIt/update.pzrv6qD/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /var/folders/_0/611900jn0yb43f1rc47_2wmh0000gp/T/vscode-typescript/tscancellation-7b26a6a36d3ab92cf020.tmp* --logVerbosity verbose --logFile /Users/matb/Library/Application Support/Code/logs/20190123T152713/exthost1/vscode.typescript-language-features/tsserver-log-nbozxG/tsserver.log --globalPlugins typescript-lit-html-plugin,typescript-styled-plugin,typescript-tslint-plugin --pluginProbeLocations /Users/matb/.vscode/extensions/bierner.lit-html-1.11.0,/Users/matb/.vscode/extensions/jpoissonnier.vscode-styled-components-0.0.25,/Users/matb/.vscode/extensions/ms-vscode.vscode-typescript-tslint-plugin-0.4.0 --locale en --noGetErrOnBackgroundUpdate
Your's does not which shows that we don't even think any tslint extension is enabled (or perhaps that no installed extension has a plugin that is eligible to be enabled)
@mjbvz you're talking about the tslint compiler plugin, right? How do I enable that globally?
Do you have the this VS Code extension installed and enabled in your workspace? It bundles the typescript server plugin so you should not need to install that separately
No I did not. Somehow I thought this was bundled with VS Code. I installed it and it works now.
Ok, yes this extension is not part of core vs code
The usage instructions say the following:
Presumably, this means that there is some way to get TSLint working in VS Code without installing
typescript
,tslint
, andtypescript-tslint-plugin
locally and switching from VS Code's version of typescript to the workspace version. It sounds like all you need to do isnpm install -g typescript tslint
andtslint --init
, and then when you open up a*.ts
file in your workspace and do something to trigger a TSLint warning, you'll see warnings. But I can't seem to get that to work.This is what I've tried:
Then open up foo.ts in the editor. If you do all that, you should see these typescript warnings, which are output when I run
tslint -c tslint.json foo.ts
:However, nothing shows up in the editor. What step am I missing? Or is it not possible to use this plugin without using a workspace version of typescript? In any case, the usage instructions should be updated to make it clear exactly what you need to do to get it working.