【发布时间】:2016-07-09 03:11:15
【问题描述】:
正如问题的标题所示,我们是一个团队,使用 TypeScript,但编辑器是 Atom 和 VSCode。 tsconfig.json 有问题。
- VSCode 无法识别类型,因此
ng(对于 Angular 1.x)不是 VSCode 的已知命名空间。 - 以下 tsconfig.json 由 VSCode 注释
匹配不允许的架构。
我猜,这些问题之间是有联系的。
{
"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 也不是很有帮助,因为当我删除JSON 中的filesGlob 和atom 字段时,会出现来自VSCode 的错误消息。
感谢任何建议。
【问题讨论】:
标签: angularjs typescript namespaces visual-studio-code atom-editor