Including d.ts type definition files in VSCode

I started using VSCode 0.7.0 and noticed that the notes say that you no longer need to add /// links:

With the introduction of jsconfig.json, you no longer need to use /// links in each file (this was necessary in the original versions of VS Code). Since the set of files is defined in jsconfig.json, VS Code knows which files and symbols are part of your project.

As an example, you can simply drop the type definition .d.ts file into the project folder, and the VS code will automatically select it.

However, I put a lot of such files in the typings folder, and VSCode doesn't seem to recognize them. Does anyone have experience with this?

+5
source share
3 answers

Do you have a tsconfig.json file or a jsconfig.json file? The latter is required when creating js files, the first for ts files.

+1
source

This is the jsconfig.json file that I am using:

 { "compilerOptions": { "target": "ES6", "module": "commonjs", "files": [ "typings/node/node.d.ts" ] } } 

The typings folder exists next to the jsconfig.json file in the root of the project.

If you select an unknown global object, such as __dirname in nodejs, press cmd + . ( ctrl + . on PC?), then select the Download typings that they will create for you.

+1
source

This is true, the caveat is that the sample folder must be in the same directory as tsconfig.json.

0
source

All Articles