Reputation: 3989
What is the up-to-the-minute advice on getting javascript / jQuery Intellisense in VS Code (1.4.0)? Most answers I have found use TSD, which I understand is (albeit very recently) deprecated.
I have a jsconfig.json
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
I (in this project) have a folder structure open that contains many "websites". I have tried putting the file both at the very root level of the folder structure and at the root level of what I am currently using (i.e. that which i'll run http-server from to fire up the site). No joy.
I have had Intellisense sort of working in other projects, i.e. I can "Go to Definition", and get a method parameters popup, but I have never successfully got the "type . and see the method list" thing which is what I would dearly love!!
After a search for answers yesterday, I tried npm install typings --global
, but still nothing at all.
(I am also running eslint - in the unlikely event that that makes any odds (interference?) )
What have I missed?
Upvotes: 1
Views: 227
Reputation: 15248
Typings for many popular libraries are available here, including jQuery.
VS Code can use these with both JavaScript and TypeScript.
As for your JS code, the editor cannot infer all type information due to the nature of JS, so intellisense is limited. If type safety and intellisense support is important for your project, you may consider using TypeScript.
More details on JavaScript support in VS Code.
Upvotes: 3