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:
+ [email protected] + [email protected]
Now let's write some React code so that we can lint it. Add the following component to MyComponent.js:
import...