Setting up Airbnb ESLint with React and Webpack

不羁岁月 提交于 2019-11-30 08:42:43
Erick Voodoo

So, I had the same issue, but I fixed this error using last version of current packages:

"eslint": "3.2.2",
"eslint-config-airbnb": "10.0.0",
"eslint-loader": "1.5.0",
"eslint-plugin-import": "1.12.0",
"eslint-plugin-jsx-a11y": "2.0.1",
"eslint-plugin-mocha": "2.2.0",
"eslint-plugin-react": "6.0.0",

And please, do this tutorial: React Code Style with ESLint + Babel + Webpack

module: { 
    preLoaders: [
      {
        test: /\.jsx?$/,
        loaders: ['eslint-loader'],
        include: path.join(__dirname, 'src'),
        exclude: path.join(__dirname, 'src/app/container')
      }
    ],
...
    eslint: {
      configFile: './.eslintrc',  //your .eslintrc file 
      emitWarning: true
    }

.eslintrc file

    {
      "extends": "airbnb"
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!