O'Reilly logo

React 16 Tooling by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required