Jonny Rylands
Jonny Rylands

Reputation: 323

How do I get IntelliJ 14 to pick up Typescript tsconfig.json file?

How do I configure IntelliJ 14 to pick up a Typescript tsconfig.json file?

The bundled Typescript compiler is v1.4 which doesn't support tsconfig.json files, according to:

https://github.com/Microsoft/TypeScript/wiki/tsconfig.json

Therefore in File > Settings > Languages & Frameworks > TypeScript > Compiler version, I've chosen the "Custom directory" option and set it to:

$HOME_DIR\npm\node_modules\typescript\lib

Which is my install of Typescript version 1.7.5 which does support tsconfig.json files.

This however doesn't pick up the tsconfig.json file when using the "Compile all project files" option in the TypeScript Compiler pane.

I've also tried setting a command line option of:

-p $MY_PROJ\src\main\web

which contains the tsconfig.json file. This also doesn't work and the TypeScript compiler produces an error of:

Error: Cannot start compiler process: Error: Cannot read tsconfig

Does anyone know how to get this working?

Thanks.

Upvotes: 3

Views: 5735

Answers (1)

tgk
tgk

Reputation: 4096

I'm using webpack to transpile down to JS but wanted to continue using IntelliJ auto-complete and warnings for typescript.

I re-located my tsconfig.json file to a sub-directory buildPipeline/config/tsconfig.json and IntelliJ was not picking up some of my tsc settings like "experimentalDecorators": true

Seems like I'm having success specifying the location of the config file by using --p path/to/tsconfig.json in Preferences > Languages & Frameworks > TypeScript

TypeScript service options

Hopefully that works for some others?

Upvotes: 10

Related Questions