Skip to main content

Installation

@nish1896/eslint-config works with ESLint 8.57.1 or below. For newer ESLint versions, install @nish1896/eslint-flat-config instead.

note

If you are migrating from v2 of this package, please check this guide.

You'll first need to install ESLint. If your project is a monorepo, consider creating a separate eslint-config for each package.

We will be installing v8.57.1, which was the last major version prior to the release of version 9.

npm i eslint@8.57.1 --save-dev

Next, install @nish1896/eslint-config.

npm install @nish1896/eslint-config --save-dev

Paste the following scripts in your package.json file

"lint": "eslint .",
"lint:fix": "eslint --fix ."

The first script will check for lint warnings in your code while the second script will format code as per the rules specified in the eslint configuration of your application. The remaining warnings or errors need to be manually fixed by the developer.

tip

You can also add "lint" command to your package.json file through command line.

npm pkg set scripts.lint="eslint --fix ."

After that, you can run ESLint on any file or directory like this:

npx eslint yourfile.js

This config extends the following plugins -