最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - vscode: [ts] Experimental support for decorators is a feature that is subject to change - Stack Overflow

programmeradmin5浏览0评论

I'm getting "[ts] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning."

I'm new to Angular and I don't how to solve it.

My tsconfig.json file :

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

Print :

I'm getting "[ts] Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning."

I'm new to Angular and I don't how to solve it.

My tsconfig.json file :

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

Print :

Share Improve this question edited Nov 24, 2019 at 18:53 Jack Lu 1702 silver badges13 bronze badges asked Aug 9, 2017 at 1:29 Joab SantosJoab Santos 5222 gold badges9 silver badges22 bronze badges 3
  • Which version pf TypeScript is VSCode using? (See the bottom right corner in VSCode) – Saravana Commented Aug 9, 2017 at 3:21
  • Please check this answer – Manoj Paul Commented Apr 12, 2018 at 9:17
  • Thanks for answering, but I already have the answer below, and it worked. – Joab Santos Commented Apr 12, 2018 at 14:03
Add a comment  | 

4 Answers 4

Reset to default 11

You've opened the editor on the src folder. For vscode's language service to find your tsconfig, you need to open the editor on the true root of the project holding your config.

Opened on root folder:

Opened on src folder:

You can set

"javascript.implicitProjectConfig.experimentalDecorators": true

in your vscode setting.

Move your tsconfig.json inside the root folder and restart the IDE. That should work.

Meirion Hughes answer is correct, I just want to add that this works in JS environments as well.

In that case name the config file jsconfig.json.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论