Adding React plugins to ESLint

Let's assume that you want to use the Airbnb set of ESLint rules after having tried it out and liking it. Let's also assume that you want to lint your React component code as well. During the ESLint init process, you've answered No to the question that asks whether or not your project uses React. This time, let's say Yes. So, once again, run the ESLint init process:

npm run lint -- --init

And once again, you want to use the Airbnb lint rules:

? Which style guide do you want to follow? 
  Google 
› Airbnb 
  Standard  

When it asks if you use React, say Yes:

? Do you use React? (y/N) y

You'll notice that a couple of extra packages are installed:

+ eslint-plugin-react@7.5.1
+ eslint-plugin-jsx-a11y@6.0.3  

Now let's write ...

Get React 16 Tooling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.