Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use a relative path to configure typescript sdk?

Can I set up typescript.tsdk relative to my project dir/tsconfig file? It looks like this option works only with an absolute path.

like image 528
Victor Savkin Avatar asked Jul 09 '15 04:07

Victor Savkin


2 Answers

In your project's .vscode/settings.json:

{
  "typescript.tsdk": "node_modules/typescript/lib"
}
like image 156
Nevir Avatar answered Sep 24 '22 16:09

Nevir


You can set in setting.json like this:

    "typescript.tsdk": "node_modules/typescript/bin"

But this break ts files that no have typescript installed by npm in root folder. The best solution I have found, was:

    "typescript.tsdk": "/Users/<MyUser>/AppData/Roaming/npm/node_modules/typescript/bin"

Still work on ts projects without typescript installed localy.

like image 31
Abraão Alves Avatar answered Sep 24 '22 16:09

Abraão Alves