In Atom Editor I installed the following plugins
- linter
- linter-eslint
It seems they don't recognize the JSX syntaxis.
I have it working on the command line but had to use other plugins like esprima-fb
and eslint-plugin-react
. Looks like there are no such plugins for Atom Editor and would like to know if anyone of you knows a way to hack around this.
I use Atom and it works just fine. You just need an
.eslintrc
in your project root which tells ESLint that you're usingeslint-plugin-react
.Updated answer for 2016: just install the
react
package in Atom and add a.eslintrc
file in your project root (or in your home dir) containing the following:And re-open any files containing JSX and it should work.
You need to edit a project local
.eslintrc
file that will get picked up by ESLint. If you want integration with Atom, you can install the plugins linter and linter-eslint.To quickly setup ESLint for React best practices, current best option is installing the npm package
eslint-plugin-react
and extending theirrecommended
configuration instead of toggling many rules manually:This will enable
eslint-plugin-react
and recommended rules from ESLint & React presets. There is more valuable information in the latest ESLint user-guide itself.Here is an example of parser options optimized for ES6 and webpack:
To get Eslint working nicely with React.js:
npm install eslint-plugin-react
"plugins": ["react"]
to your .eslintrc config file"ecmaFeatures": {"jsx": true}
to your .eslintrc config fileHere is an example of a
.eslintrc
config file:I am using Eslint v1.1.0 at the moment.
Side note: I had to install both eslint and eslint-plugin-react as project dependencies (e.g.,
npm install eslint eslint-plugin-react --save-dev
). Hopefully this helps.For Mac user: Go to Atom --> preferences --> Install --> search package linter-eslint --> click install
For Ubuntu user: Go to Edit --> preferences --> Install --> search package linter-eslint --> click install
go to command line ---> npm install --save-dev eslint-config-rallycoding
Come to atom make new file .eslintrc and extend the rallycoding.