简体   繁体   English

VSCode 尝试创建新模块时对装饰器的实验性支持警告

[英]VSCode Experimental Support for Decorators Warning When Trying to Create New Module

I just installed Angular 10 and upgraded VSCode to the latest.我刚刚安装了 Angular 10 并将 VSCode 升级到最新。

When creating a new module:创建新模块时:

import { NgModule } from '@angular/core';

const mm = []

@NgModule({
    imports: [ ...mm ],
    exports: [...mm
    ],
    providers: [     
    ]
})
export class MaterialModule {

}

This decorator error is created:创建此装饰器错误:

class MaterialModule
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.ts(1219)

And it is only created for the new module.它只是为新模块创建的。 The existing app.module.ts is error free...so it's a bit confusing.现有的app.module.ts没有错误……所以有点混乱。

Thoughts?想法? 在此处输入图像描述

Add this line in your tslint.config to avoid this lint error.tslint.config中添加此行以避免出现此 lint 错误。

"experimentalDecorators": true “实验装饰器”:真

and also checked the enable experimental decorator option in visual studio setting like below并且还检查了 Visual Studio 设置中的启用实验性装饰器选项,如下所示在此处输入图像描述

Hope it will help.希望它会有所帮助。

I uninstalled and reinstalled "Angular Language Support" in VSCode and that did the trick.我在 VSCode 中卸载并重新安装了“Angular Language Support”,就成功了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 vscode:[ts] 对装饰器的实验性支持是一项可能会发生变化的功能 - vscode: [ts] Experimental support for decorators is a feature that is subject to change Now.sh 构建中断的原因是:当前未启用对实验性语法“decorators-legacy”的支持 - Now.sh build breaking due to: Support for the experimental syntax 'decorators-legacy' isn't currently enabled React Native 中当前未启用对实验性语法“decorators-legacy”的支持 - Support for the experimental syntax 'decorators-legacy' isn't currently enabled in React Native 语法错误 - 当前未启用对实验性语法“decorators-legacy”的支持 - Syntax error - Support for the experimental syntax 'decorators-legacy' isn't currently enabled NodeJS 中的实验性 ES 模块加载是否支持导入命名导出? - Does experimental ES Module loading in NodeJS support importing named exports? 支持DNSSEC和/或实验性新RR类型的DNS解析器库 - DNS resolver libraries with support for DNSSEC and/or experimental new RR types 尝试要求未安装但不必要的模块时发出警告 - Warning when trying to require a module which is not installed but not necessary Babel-Standalone 错误:内联 Babel 脚本:当前未启用对实验性语法“decorators-legacy”的支持 (14:1): - Babel-Standalone Error : Inline Babel script: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (14:1): 在我创建的所有新项目中,我无法修复 vscode 的 JSHint 插件中的“let”警告 - I can't fix the “let” warning in JSHint plugin for vscode in all the new projects I create 在 tsc --init 期间打开实验性装饰器? - Turn on experimental decorators during tsc --init?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM