相关疑难解决方法(0)

VSCode Linter ES6 ES7 Babel linter

如何使用Visual Studio代码根据babel/ES7 stage-0规则lint JavaScript文件?

我只需要lint代码.我已经有webpack转换Js文件了.

javascript eslint babeljs ecmascript-7 visual-studio-code

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

语法需要一个名为 __spreadArrays 的导入助手

当我尝试在打字稿中使用传播时,例如:

.reduce((unique, x) => {
    unique.some(element => element.machineName === x.machineName) ? unique : [...unique, x];
}
Run Code Online (Sandbox Code Playgroud)

我收到红色标记的警告Visual Studio Code

the syntax requires an imported helper named __spreadArrays

typescript version: "2.3.4"
target: "es5"
Run Code Online (Sandbox Code Playgroud)

我认为在以后的版本中这个问题是固定的,但现在我无法迁移。我该如何解决?

注意:项目编译得很好并且工作正常。但红色的底层VS Code在烦人。

javascript spread typescript visual-studio-code

34
推荐指数
5
解决办法
3万
查看次数

understanding the source of vscode squiggly lines

I opened a js file with ES7 property initializers and am getting squiggly lines:

class AppContainer extends Component {
  static propTypes = {
    history: PropTypes.object.isRequired,
    routes: PropTypes.object.isRequired,
    store: PropTypes.object.isRequired
}
Run Code Online (Sandbox Code Playgroud)

The error says:

[js] 'property declarations' can only be used in a .ts file.
Run Code Online (Sandbox Code Playgroud)

I am curious how to fix this, of course. But I am more curious how to debug what is giving this error? This is one of the more frustrating parts of some editors, understanding what is …

visual-studio-code

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