I want configure ESLint for check my JSX files but my configuration doesn't work. What is the correct way?
.eslintrc.js:
module.exports = {
extends: 'airbnb',
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
plugins: [
'react',
],
parser: 'babel-eslint'
};
In order to lint JSX files configuration alone is not enough. Your configuration looks fine (although you probably don't need babel-eslint
, unless you are using features that are lower than stage 4 proposal). By default ESLint will only process .js
files. You have to tell it that you want to process .jsx
files as well by using --ext
flag on command line: eslint --ext .jsx .