Eslint说解析错误:意外的令牌/

时间:2018-11-08 13:32:41

标签: javascript reactjs jsx eslint eslint-config-airbnb

eslint在第11行抱怨以下模块。src / index.js第11行:分析错误:意外的令牌/

import React from 'react';
import { render } from 'react-dom';
import './assets/css/index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { AppContainer } from 'react-hot-loader';

const render_ = () => {
    render(       
        <AppContainer>
          <App />
        </AppContainer>,
        document.getElementById('root')
    );
};

registerServiceWorker();
render_();

if (module.hot) {
    module.hot.accept('./App', () => {
        render_();
    });
}

我正在使用eslint-config-airbnb,.eslintrc.js中的parserOptions字段如下所示:

"parserOptions": {
  "ecmaFeatures": {
    "globalReturn": true,
    "generators": false,
    "objectLiteralDuplicateProperties": false,
    "jsx": true
  },
  "ecmaVersion": 2018,
  "sourceType": "module"
},

0 个答案:

没有答案