简体   繁体   中英

Configuring eslint for VsCode to support type declaration files?

I am using vsCode for my development and due to the odd nature of my environment I have an api that I can't physically access, currently i'm writing up manual .d.ts files that will act as a psuedo sdk to provide intellisense information and hopefully, linting. Issue is eslint in vscode doesn't seem to want to read those files when telling me what variables are undefined, i'm also not entirely sure how to set that all up correctly?

Update: I believe I solved the issue, by putting, //@ts-check at the top of my javascript file, and using the reference path inline xml tslint seems to start working, giving me linting based on my type declaration files. Also using checkJs: true in your tsconfig.json works as well.

It sounds like you're simply trying to get VSCode to do interactive type-checking, and give you intellisense, for a Typescript-based project.

If that's correct, you shouldn't have to do ANYTHING special.

I installed John Papa's "Angular Essentials" extension, which happens to include Typescript support. Althought I would recommend this, there are a million other VSCode Typescript extensions freely available; most any of them should also do what you need.

I would also install the Chrome Debugger extension, if you haven't already done so.

Q: Does that help, or do you have specific questions that I haven't covered, or specific problems/issues with things you've already tried?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM