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

Unexpected token = for a arrow Function using StandardJS

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

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

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

错误来自 Standard linter, not from PHPStorm parser, that's why changing JavaScript language version in preferences doesn't help... You are using ES7 proposal for class properties (https://github.com/tc39/proposal-class-public-fields). But it's not yet a part of any spec, and the parser used by Standard linter doesn't support it. You need using a different parser here - see https://standardjs.com/#how-do-i-use-experimental-javascript-es-next-features