Search code examples
typescriptwarningswebstormdecorator

Jetbrains WebStorm gives warning: Experimental support for decorators is a feature that is subject to change


I already have been searching for some time on this warning and setting the experimentalDecorators in my tsconfig file does not seem to remove the warning. I'm working in an Ionic project with Angular. And the IDE I am using is webstorm by JetBrains. If you need additional information, do ask.

My tsconfig.json file:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "experimentalDecorators": true,
    "allowJs": true,
    "emitDecoratorMetadata": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5",
    "noUnusedLocals": false,
    "noUnusedParameters": false
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "src/**/*.spec.ts",
    "src/**/__tests__/*.ts"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}


Solution

  • I totally forgot I had a file tsconfig.spec.json which was empty. Pasting my configuration from tsconfig.json into the tsconfig.spec.json file fixed the issue. Apparently WebStorm looks for the nearest tsconfig.*.json config file and for me it was the tsconfig.spec.json not the tsconfig.json file.