tsconfig.json:在与 Atom 和 VSCode 的团队中使用 TypeScript?

tsconfig.json: using TypeScript in a team with Atom and VSCode?

正如问题标题所示,我们是一个使用 TypeScript 的团队,但编辑 Atom VSCode。 tsconfig.json.

有问题
  1. VSCode 无法识别类型,因此 ng(对于 Angular 1.x)不是已知的命名空间VSCode.
  2. 以下 tsconfig.json 被 VSCode 评论为

    Matches a schema that is not allowed.

我想,这些问题之间是有联系的。


{
    "compilerOptions":
        {
            "target": "es5",
            "module": "commonjs",
            "declaration": false,
            "noImplicitAny": false,
            "removeComments": true,
            "noLib": false,
            "preserveConstEnums": true,
            "suppressImplicitAnyIndexErrors": true,
            "outDir": "./tmp/typescript",
            "rootDir": "./our/ts/dir"
        },
    "filesGlob": [
        "./src/**/*.ts",
        "!./node_modules/**/*.ts",
        "./bower_components/our_library/src/company/**/*.ts",
        "./typings/tsd.d.ts"
    ],
    "files": [
        "./src/example.ts",
        "./src/many/many/entries/any.ts",
        "./src/lib.ts/a_library.ts",
        "./src/lib.ts/angular.ts",
        "./src/lib.ts/jquery.ts",
        "./src/lib.ts/lodash.ts",
        "./src/lib.ts/moment.ts",
        "./src/lib.ts/restangular.ts",
        "./src/lib.ts/selectize.ts",
        "./src/lib.ts/systemjs.ts",
        "./typings/tsd.d.ts"
    ],
    "exclude": [],
    "atom": {
        "rewriteTsconfig": true
    }
}

我尝试根据 , but the answer does not help (the typings are already included in the tsconfig.json). Also reading the tsconfig.json spec 来解决问题,但没有太大帮助,因为当我删除 filesGlob 和 [=17= 时,会出现来自 VSCode 的错误消息] JSON.

中的字段

如有任何建议,我们将不胜感激。

第 2 期:

您必须删除 exclude 属性。如果它与 files 属性 一起使用,则 files 属性 优先。

您可以在此处阅读有效 tsconfig 的完整规范: https://github.com/Microsoft/TypeScript/wiki/tsconfig.json