TypeStrong / grunt-ts

A grunt task to manage your complete typescript development to production workflow
https://www.npmjs.com/package/grunt-ts
MIT License
330 stars 121 forks source link

grunt-ts does not work with empty "types" array in tsconfig.json #442

Closed danielrentz closed 3 years ago

danielrentz commented 4 years ago

I am using grunt-ts with a project file containing an empty "types" array to not load any type definitions from node_modules (as documented here).

{
    "compilerOptions": {
        "types": []
    }
}

Using tsc directly works as expected. But grunt-ts fails with

Using tsc v3.7.3
error TS6044: Compiler option 'types' expects an argument.

Maybe this is related to (https://github.com/microsoft/TypeScript/issues/18581)?

nycdotnet commented 4 years ago

hi - the best way around this is to use the tsconfig.json integration with passThrough turned on. In this mode, grunt-ts just calls TypeScript and lets it handle the rest.

grunt.initConfig({
  ts: {
    default: {
      // specifying tsconfig as an object allows detailed configuration overrides...
      tsconfig: {
        tsconfig: './sometsconfig.json',
        passThrough: true
      }
    }
  }
});
danielrentz commented 4 years ago

Thanks for this hint!