ESLint仍在投掷error Parsing error: Unexpected token ..
,我似乎无法弄明白为什么。
.eslintrc.js
:
module.exports = {
extends: "devmountain/react-config"
, rules: {
quotes: [ 1, "double" ]
}
, "ecmaVersion": 6
, "ecmaFeatures": {
"experimentalObjectRestSpread": true
}
};
从here
延伸有问题的代码:this.setState( { ...this.state, editorState } );
答案 0 :(得分:2)
ecmaFeatures
和ecmaVersion
选项位于parserOptions
下。例如:
...
"extends": "devmountain/react-config",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
},
"ecmaVersion": 6
},
...
答案 1 :(得分:0)
在v6.0.0(及更高版本)中,已弃用的experimentalObjectRestSpread选项为removed
这是新代码:
{
"parserOptions": {
"ecmaVersion": 2018
}
}