Parsing error: Unexpected token =
当我尝试整理Es6类时,ESLint引发错误。我缺少在eslint中启用胖箭头类方法的配置参数吗?
范例类别:
class App extends React.Component{
...
handleClick = (evt) => {
...
}
}
.eslint
{
"ecmaFeatures": {
"jsx": true,
"modules":true,
"arrowFunctions":true,
"classes":true,
"spread":true,
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"rules": {
"strict": 0,
"no-underscore-dangle": 0,
"quotes": [
2,
"single"
],
}
}
您的示例不是有效的ES6,因此无法配置eslint允许它