Yikes! ESLint

The Airbnb Way

As a developer, working in a team or collaborating with other developers is inevitable. How can we ensure all these different developers, program following the same pattern or standard?

A style guide.

What is a style guide?

A style guide is a set of standards that outline how code should be written and organized.

What is ESLint?

Like a Spell checker for spellings, ESLint is used to find problematic patterns or code that doesn’t adhere to certain style guidelines.

ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs.

ESLint at work
The Airbnb way

How to configure ESLint?

npm install eslint --save-dev

After installing, the next step is to set up your configuration file

eslint --init

The first time I encountered this tool was in preparation for the Andela Bootcamp. We were advised to use ESLint: Airbnb Javascript Style Guide in one of the challenges we were given.

The primary reason ESLint was created was to allow developers to create their own linting rules, which is what the Airbnb team did.

Although, I found using ESLint a little frustrating, it was the first time I had to make sure things were done the right way. Eventually, I came to appreciate it, as it fostered code readability and made my codes easy to maintain. It helped me remain consistent, careful and considerate while coding.

.eslintrc.json file

For more information on how to configure ESLint, please refer to this link: https://eslint.org/docs/user-guide/getting-started

Like what you read? Give Phebian Chukwurah a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.