electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

Not all typescript options seem to work #254

Open jordanebelanger opened 7 years ago

jordanebelanger commented 7 years ago

Hi folks,

Here is an excerpt of my .compilerc:

"text/typescript": {
        "module": "commonjs",
        "target": "es6",
        "lib": ["es6", "dom"],
        "sourceMap": true,
        "allowJs": true,
        "jsx": "react",
        "moduleResolution": "node",
        "outDir": "dist",
        "forceConsistentCasingInFileNames": true,
        "noImplicitReturns": true,
        "noImplicitThis": true,
        "noImplicitAny": true,
        "strictNullChecks": true,
        "suppressImplicitAnyIndexErrors": true,
        "noUnusedLocals": true
      }

I know my file is getting at least partially executed because some of these properties, for example the "module" property, are factored in when I run my app.

On other-hand, the strictNullChecks option does not seem to work, for example this line: const someVar: string = null executes just fine without throwing any error.

Meanwhile, trying the same in the typescript playground with the strictNullChecks option set to true properly return an error: https://www.typescriptlang.org/play/index.html#src=const%20someVar%3A%20string%20%3D%20null

Am I missing anything here? Why are these compiler options ignored?