正如问题的标题所示,我们是一个团队,使用 TypeScript,但编辑器是 Atom 和 VSCode。我们在使用 tsconfig.json
时遇到问题.
ng
(对于 Angular 1.x)不是 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
}
}
我已尝试根据 this question 管理该问题,但答案没有帮助(打字已经包含在 tsconfig.json 中)。还在阅读
tsconfig.json spec
不是很有帮助,因为当我删除 filesGlob
时会出现来自 VSCode 的错误消息和 atom
JSON 中的字段。任何建议表示赞赏。
最佳答案
对于问题 2:
您必须删除 exclude
属性(property)。如果与files
一起使用属性(property)files
属性(property)优先。
您可以在此处阅读有效 tsconfigs 的完整规范:
https://github.com/Microsoft/TypeScript/wiki/tsconfig.json
关于angularjs - tsconfig.json : using TypeScript in a team with Atom and VSCode?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36150876/