Use ESLint with Airbnb guidelines (React)

Stefano Di Cecco
2 min readMar 10, 2021

Let me explain how to use ESLint with Airbnb guidelines in the right way inside your react app.

First of all create a new react app called eslint-configwith npx command like this

Then, we can add the libraries needed to configure our eslint file, we need to add the main eslintlibrary after the eslint-config-airbnbguidelines and at the end babel-eslint to use as a parser with options within our configuration.

Finally, we can add the .eslintrc file in the root folder of our project

At the end of scripts inside the package.json we can add the lint command to use our configuration e run it in like this

And that’s it, now you can be ready to do magic in your new React app!

Yaaay! 🎉

I hope you learned some new stuff !!!

Leave a comment if you want or ask some questions and if you like follow me!

Cheers!

--

--

Stefano Di Cecco

Self-motivated IT professional with great knowledge and proficiency in JavaScript, TypeScript. Expertise in frameworks like React.js, Angular.