标准JS为什么说sign =是一个意外的令牌? 我正在使用PhpStorm。
代码工作得很好,我只是按照https://github.com/whoisandy/react-rangeslider的教程,得到了这个错误。
handleOnChange = (value) => { this.setState({ volume: value }) }
Why the Standard JS is saying that the sign = is a unexpected token? I'm using PhpStorm.
The code works perfectly, I'm just following the tutorial from https://github.com/whoisandy/react-rangeslider and got this error.
handleOnChange = (value) => { this.setState({ volume: value }) }最满意答案
错误来自Standard linter,而不是来自PHPStorm解析器,这就是为什么在首选项中更改JavaScript language version没有帮助...您正在使用ES7提议进行类属性( https://github.com/tc39/proposal-class-public - 场 )。 但它还不是任何规范的一部分,标准linter使用的解析器不支持它。 您需要在此处使用不同的解析器 - 请参阅https://standardjs.com/#how-do-i-use-experimental-javascript-es-next-features
Error comes from 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
更多推荐
发布评论