相关疑难解决方法(0)

TypeScript编译中的实验装饰器警告

我有

对装饰器的实验性支持是一个在将来的版本中可能会发生变化的功能.设置'experimentalDecorators'选项`以删除此警告.

甚至我在tsconfig.json中的compilerOptions都有设置:

"emitDecoratorMetadata": true,
"experimentalDecorators": true,
Run Code Online (Sandbox Code Playgroud)

有些奇怪的是,一些使用装饰器的随机类没有显示出警告,但在同一个项目中却没有.

什么可能导致TypeScript编译器的这种行为?

decorator typescript visual-studio-code

183
推荐指数
23
解决办法
13万
查看次数

我可以使用相对路径来配置typescript sdk吗?

我可以设置相对于我的项目dir/tsconfig文件的typescript.tsdk吗?看起来此选项仅适用于绝对路径.

typescript visual-studio-code

14
推荐指数
2
解决办法
8908
查看次数

对装饰器的实验性支持是一个在将来的版本中可能会发生变化的功能

我刚从github克隆angular2-seed项目并按照步骤进行操作,但是我在VS代码中得到了这个警告[ts]对装饰器的实验支持是一个在将来的版本中可能会发生变化的功能.设置'Exxperimentaldecorators'选项以删除此警告.

visual-studio angular-seed angular

8
推荐指数
5
解决办法
1万
查看次数

如何去掉“警告:这是一项实验性功能,可能随时更改”消息

基本上,我遵循了 VSCode: Is it possible to subpressexperimentaldecorator warnings以便取出此类消息,但没有产生任何效果。

首先,我收到这样的消息:

“(节点:15077)DeprecationWarning:node --debug 已弃用。请改用node --inspect”。我在某处读到在 launch.json 中添加 "protocol": "auto" (老实说,我不知道我设置了什么自动)。

它更改了本主题中提到的警告。好吧,我已将 jsconfig.json 添加到项目根目录,但似乎没有改变任何内容。

我不知道它是否相关,但我注意到 Visual Studio Code About 指向 Node 6.5.0,而我的本地节点是 7.7.4。

最后但并非最不重要的一点是,这样的警告意味着什么?

启动.json

{
    // Use IntelliSense to learn about possible Node.js debug attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceRoot}/server.js",
            "protocol": "auto"
        },
        {
            "type": "node",
            "request": "attach", …
Run Code Online (Sandbox Code Playgroud)

node.js npm visual-studio-code

8
推荐指数
1
解决办法
2万
查看次数

实验装饰者警告VSCODE

我正在研究Angular2-Typescript应用程序.我用angular-cli生成了如下项目:

ng new myApp
Run Code Online (Sandbox Code Playgroud)

但是当我创建一个新组件时,@ Component标签上会出现一个警告.

我试着在这篇文章后解决:

Visual Studio Code中的实验装饰器警告

但对我不起作用.

我附上我的tsconfig.json:

{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es6",
"typeRoots": [
  "../node_modules/@types"
  ]
 }
}
Run Code Online (Sandbox Code Playgroud)

打字稿版本是:"打字稿":"2.0.2"

typescript visual-studio-code angular2-cli angular

5
推荐指数
1
解决办法
2095
查看次数