意外的标记=箭头使用StandardJS的函数

时间:2017-06-14 22:10:26

标签: reactjs phpstorm standards

为什么标准JS会说标志=是一个意外的标记?我正在使用PhpStorm。

代码完美无缺,我只是按照https://github.com/whoisandy/react-rangeslider的教程进行操作并得到了这个错误。

handleOnChange = (value) => {
 this.setState({
  volume: value
 })
}

enter image description here

1 个答案:

答案 0 :(得分:1)

错误来自Standard linter,而不是来自PHPStorm解析器,这就是为什么更改首选项中的JavaScript language version并没有帮助...您正在使用ES7提议进行类属性( https://github.com/tc39/proposal-class-public-fields)。但它还不是任何规范的一部分,而标准linter使用的解析器并不支持它。您需要在此处使用其他解析器 - 请参阅https://standardjs.com/#how-do-i-use-experimental-javascript-es-next-features

相关问题