As we mentioned before, ESLint is a pluggable linter. That means it is completely configurable and that you can switch off every rule, or some of them, or mix custom rules to make ESLint specifically suited for your project. Let's use ESLint in the API we have created with one of the following configurations. There are two methods to configure ESLint:
- Use the JavaScript comments directly with the ESLint configuration information in a file, as in the following example:
// eslint-disable-next-line no-unused-vars
import authenticate from 'middlewares/authenticate'
- Use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories.
Using the first method can be time-consuming because you may need to provide the ESLint configuration information in every .js file, while in the second method, you just need to configure it once in a .json file. So let's use the second method for our API...