TSLint 抱怨@Component 的 module.id "Corresponding file not included in tsconfig.json"(在 WebStorm 中)
TSLint complains @Component's module.id "Corresponding file not included in tsconfig.json" (in WebStorm)
简单的问题,在 WebStorm 中:
除此之外,tsc
抱怨:
error TS2304: Cannot find name 'module'.
我正在寻找:
- 对于像 jshint's
"predef"
这样的键,它允许您忽略在活动检查范围之上定义的全局变量,或者
- 向我的
@Component
添加一些注释或导入,我忘记允许 TSLint 查看 module
、which comes from SystemJS.
重要的是,我不想添加代码内//noinspection TypeScriptUnresolvedVariable
,因为这个moduleId: module.id
模式在每个组件中都是必需的我们有。它看起来不像是应该被系统地忽略的东西。
我注意到 TSLint has an ignore-pattern
directive,但它是 no-unused-variable
的子集,这不是我要找的。
我在本地使用带有 TSLint 2 的 WebStorm 2016.2.4。这是我的 tsconfig.json:
{
"version": "2.0.3",
"compileOnSave": false,
"compilerOptions": {
"outDir": "dist",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"module": "system",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"noImplicitAny": true,
"allowSyntheticDefaultImports": true
},
"typeRoots": [ "node_modules/@types" ],
"filesGlob": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
我也试过了
"compilerOptions" {
"target": "es5",
"module: "commonjs",
... }
无果。
我想这是由短暂的事情引起的,因为我已经好几个星期没有看到它了。
简单的问题,在 WebStorm 中:
除此之外,tsc
抱怨:
error TS2304: Cannot find name 'module'.
我正在寻找:
- 对于像 jshint's
"predef"
这样的键,它允许您忽略在活动检查范围之上定义的全局变量,或者 - 向我的
@Component
添加一些注释或导入,我忘记允许 TSLint 查看module
、which comes from SystemJS.
重要的是,我不想添加代码内//noinspection TypeScriptUnresolvedVariable
,因为这个moduleId: module.id
模式
我注意到 TSLint has an ignore-pattern
directive,但它是 no-unused-variable
的子集,这不是我要找的。
我在本地使用带有 TSLint 2 的 WebStorm 2016.2.4。这是我的 tsconfig.json:
{
"version": "2.0.3",
"compileOnSave": false,
"compilerOptions": {
"outDir": "dist",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"module": "system",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"noImplicitAny": true,
"allowSyntheticDefaultImports": true
},
"typeRoots": [ "node_modules/@types" ],
"filesGlob": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
我也试过了
"compilerOptions" {
"target": "es5",
"module: "commonjs",
... }
无果。
我想这是由短暂的事情引起的,因为我已经好几个星期没有看到它了。