atom-typescript - 为什么无法识别这些 Typescript 配置选项?

atom-typescript - Why are these Typescript config options not recognised?

为什么我会收到下面屏幕截图中显示的错误?

A​​tom 说我的 tsconfig.json 'project file contains invalid options' 用于 allowJs、buildOnSave 和 compileOnSave。

但应该允许这些设置:https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md

看起来这些选项还没有添加到 Atom TypeScript 中。看看他们的界面,它缺少您遇到问题的属性。

https://github.com/TypeStrong/atom-typescript/blob/e2fa67c4715189b71430f766ed9a92d9fb3255f9/lib/main/tsconfig/tsconfig.ts#L8-L35

interface CompilerOptions {
    allowNonTsExtensions?: boolean;
    charset?: string;
    codepage?: number;
    declaration?: boolean;
    diagnostics?: boolean;
    emitBOM?: boolean;
    help?: boolean;
    locale?: string;
    mapRoot?: string;                                 // Optionally Specifies the location where debugger should locate map files after deployment
    module?: string;                                  //'amd'|'commonjs' (default)
    noEmitOnError?: boolean;
    noErrorTruncation?: boolean;
    noImplicitAny?: boolean;                          // Error on inferred `any` type
    noLib?: boolean;
    noLibCheck?: boolean;
    noResolve?: boolean;
    out?: string;
    outDir?: string;                                  // Redirect output structure to this directory
    preserveConstEnums?: boolean;
    removeComments?: boolean;                         // Do not emit comments in output
    sourceMap?: boolean;                              // Generates SourceMaps (.map files)
    sourceRoot?: string;                              // Optionally specifies the location where debugger should locate TypeScript source files after deployment
    suppressImplicitAnyIndexErrors?: boolean;
    target?: string;                                  // 'es3'|'es5' (default)|'es6'
    version?: boolean;
    watch?: boolean;
}

compileOnSavebuildOnSave 不属于 CompilerOptions。像这样:

{
  "compileOnSave": true,
  "buildOnSave": false,
  "compilerOptions": {
    "module": "system",
    "noImplicitAny": true,
    "preserveConstEnums": true,
    "removeComments": true,
    "sourceMap": true,
    "target": "es5"
    },
    "exclude": [
    "node_modules",
    "wwwroot/lib",
    "typings/main",
    "typings/main.d.ts"
  ]
}

allowJs 似乎不受支持,但很快就会支持。这是 GitHub 上的一个分支,显示他们已经添加了它,只是还没有合并它。