使用vscode 编辑typescript,添加了模块之后显示error
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
vscode是最新版本
Version: 1.56.0
Date: 2021-05-04T22:06:21.189Z (1 day ago)
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 19.4.0
tsconfig.json中添加了
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
解决方案是在vscode的setting中设置
"js/ts.implicitProjectConfig.experimentalDecorators":true
参考:Experimental decorators warning in TypeScript compilation