Simple problem, in WebStorm:
In addition to that, tsc
complains with:
error TS2304: Cannot find name 'module'.
I'm looking either:
- For something like jshint's
"predef"
key that allows you to ignore global variables that are defined above the scope of the active inspection, or - To add some annotation or import to my
@Component
that I have forgotten to allow TSLint to seemodule
, which comes from SystemJS.
Importantly, I do not want to add in-code //noinspection TypeScriptUnresolvedVariable
because this moduleId: module.id
pattern is well-known for Angular2 and required in every single component we have. It doesn't look like something that should be ignored systemically.
I noticed that TSLint has an ignore-pattern
directive, but it's a subset of no-unused-variable
, which is not what I'm looking for.
I'm using WebStorm 2016.2.4 with TSLint 2 locally. Here is my 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"
]
}
I have also tried
"compilerOptions" {
"target": "es5",
"module: "commonjs",
... }
To no avail.