I am trying to set up linting with Airbnb's Javascript standards on my React project, it uses webpack.
Updated with latest packages based on comments.
"babel-eslint": "^6.1.2",
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
"eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0",
"jshint": "^2.9.2",
"jshint-loader": "^0.8.3",
"json-loader": "^0.5.4",
I also have a preloader setup in my webpack config
preLoaders: [
{
test: /\.jsx?$/,
loaders: ['eslint'],
// define an include so we check just the files we need
include: PATHS.app
}
],
And the following set up for running the script
"lint": "eslint . --ext .js --ext .jsx --ignore-path .gitignore --cache",
I also have a .eslintrc
file which has the following
{
"extends": "airbnb",
"env": {
"node": true,
"es6": true
}
}
This gives me the following error:
Configuration for rule "react/jsx-sort-props" is invalid:
Value "data["0"].shorthandLast" has additional properties.
If i remove the .eslintrc
file which i thought might be conflicting, I get the following error:
error Parsing error: The keyword 'const' is reserved
Followed by a npm error which causes the task to exit.
"eslint": "^2.13.1",
even if you have that installed globally. – Hallameslint-plugin-react
is up to date too. They released6.0.0
just a while ago and that might fix your issue given that's where the error stems from. – Hallameslint: {configFile: '.eslintrc'}
could you try after adding it – Thomajan