TypeStrong / atom-typescript

The only TypeScript package you will ever need
https://atom.io/packages/atom-typescript
MIT License
1.13k stars 205 forks source link

compileOnSave setting has no effect when it's not declared in primary tsconfig file #1481

Closed nene closed 5 years ago

nene commented 5 years ago

I have a setup where the tsconfig.json file extends from tsconfig.default.json:

tsconfig.json:

{
  "extends": "./tsconfig.defaults",
  "include": [
    "src/**/*.ts"
  ]
}

tsconfig.defaults.json:

{
  "compileOnSave": true,
  "compilerOptions": {
    "module": "commonjs"
  }
}

When I move compileOnSave setting to the main tsconfig.json file, then atom typescript starts compiling on save. But when the setting is inside extended file, it has no effect.

lierdakil commented 5 years ago

Hi. Thanks for reporting! Sorry I didn't respond sooner. I was pretty sure I did, but evidently not. December was insane crunch time.

This should be fixed in v13.0.0. If you could verify, that would be great.

nene commented 5 years ago

Hi @lierdakil,

unfortunately 13.0.0 hasn't fixed my problem. When I remove compileOnSave from tsconfig.json, atom-typescript stops compiling, even though the setting is defined in the config file from where it extends from.

lierdakil commented 5 years ago

Right, sorry. I had a misconception about some TypeScript internals apparently. This should be fixed in v13.0.1.

nene commented 5 years ago

This now works when I have:

{
  "extends": "./tsconfig.defaults.json"
}

But it doesn't work when there is no file extension specified:

{
  "extends": "./tsconfig.defaults"
}

The latter form is however supported by typescript compiler itself.

lierdakil commented 5 years ago

Thanks for pointing this out. Should be fixed in v13.0.2.

nene commented 5 years ago

Thanks a lot!

This now works perfectly for me.

Big thanks for solving this.