-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode not recognizing tslint-language-service #40
Comments
Your tslint-language-service is installed in the same folder than typescript? In other words have you that:
|
Yep - our web project (contains all the js/ts/etc. code) is a subdirectory of our core project. The structure of that web project looks like this with tslint & tsconfig being at the same level of the node_modules folder: ---> web project folder |
Please share a little project which causes your pb, thanks |
This is a drop of the codebase we're having issues with - due to size I had to delete everything from the node_modules so you'll want to run an npm install for that. server.ts has some random code that should be throwing 5-6 linter errors. I've been futzing with it today and it appears the issue might stem from namespacing. If I copy the contents from a folder with . to one without, vscode picks up the errors as expected. |
@jnarwold have you also forced the use of the project's typescript install in vscode (by clicking on the version of typescript on the bottom right of the screen, next to the smiley and then selecting "use workspace version"). @angelozerr I've noticed that if you don't set |
Yes you need that tslint-language-service is hosted inside the same folder than TypeScript, it's because of this declaration https://github.com/angelozerr/tslint-language-service/blob/master/src/index.ts#L1:
I have done like sample, but I'm not sure that's it's a good idea, see RyanCavanaugh/sample-ts-plugin#2 TypeScript 2.4 will provide the capabilty to register a plugin "globally" so I think @egamma will use this feature inside VSCode to avoid installing at hand the tslint-language-service. |
@victornoel I suggest you also try the vscode-tslint(vnext) extension. It bundles the tslint-language-service https://marketplace.visualstudio.com/items?itemName=eg2.ts-tslint |
@egamma so ultimately (when it is released), we should not use at all the tslint-language-service in our projects but simply add the extension, right? |
@victornoel the goal for vscode users is that the user can just install a VS Code extension. The extension then has the typescript language server plugin bundled, so that the user doesn't have to install both an extension and the plugin. If you want to use a different version of typescript using the tsdk setting, then you are on you need to use and configure the tslint-language-service directly. |
@egamma ok, I got it, thanks for the explanation :) |
@victornoel - Yep! I'm using TypeScript 2.3.3 on VSCode through the vscode typescript install. I don't believe this is a versioning issue, though. As I mentioned earlier, it seems to be directly linked to folder structure namespacing. |
@angelozerr Any ideas on what might be causing the namespacing issue (if that is indeed the root of my problems)? |
@jnarwold waiting for answer of RyanCavanaugh/sample-ts-plugin#2 |
@egamma How do I confirm that I've followed the steps and so far, I don't see an option to check the log for the project or some command to run the linter and get the output. Do we get a friendly output to fix the problems with links to the files with errors? Thanks a lot for the amazing work. |
@matheo you can enable logging and you should see that the tslint language service trace messages. The message would look something like: |
@egamma I'm trying with VSCode 1.22.2 and I had to select VSCode typescript version to be able to detect the plugin inside the extension But when I try to pick custom versions adding them to my local
With typescript ¬2.6 it finally worked:
and now I see this plugin is developed |
I'm not sure if I've configured something incorrectly or if vscode is just struggling but I can't manage to get vscode to lint properly through the tslint-language-service.
tsconfig.json
tslint.json
server.ts (file I'm intentionally trying to break to catch errors)
This should trip on multiple levels: no vars, single quotes, etc.
Running TypeScript 2.3.3
Note: I can run tslint via the command line and it picks up on errors as expected.
The text was updated successfully, but these errors were encountered: