【发布时间】:2020-02-08 06:26:56
【问题描述】:
当我尝试在打字稿中使用传播时:
.reduce((unique, x) => {
unique.some(element => element.machineName === x.machineName) ? unique : [...unique, x];
}
我收到来自Visual Studio Code 的红色标记警告:
the syntax requires an imported helper named __spreadArrays
typescript version: "2.3.4"
target: "es5"
我认为在以后的版本中此问题已得到解决,但现在我无法迁移。我该如何解决?
注意: 项目编译良好并且可以正常工作。但是VS Code 中的红色底层很烦人。
【问题讨论】:
-
看起来 VS Code 的目标是 es5 而不是 es6?以前没见过,也许看看这个帖子:stackoverflow.com/questions/29953293/…
标签: javascript typescript visual-studio-code spread