Skip to main content

Installation

In case you are upgrading to eslint v9 or above , please check the migration guide.

If you are using eslint v8 and are migrating from v1.0.x, please check the migration guide.

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

Please do refer the official docs to install eslint if needed.

Eslint 9 and above

npm i eslint --save-dev
yarn add -D eslint

Next, install @nish1896/eslint-flat-config.

npm install @nish1896/eslint-flat-config  --save-dev
yarn add -D @nish1896/eslint-flat-config

Eslint 8

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

npm i eslint@8.57.0 --save-dev
yarn add -D eslint@8.57.0

Next, install @nish1896/eslint-config.

npm install @nish1896/eslint-config  --save-dev
yarn add -D @nish1896/eslint-config

Add "lint" command to your package.json file.

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

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

npx eslint yourfile.js
yarn run eslint yourfile.js
info

This config extends the following plugins and parsers -

You may also choose to install other eslint plugins or configurations depending upon your application needs.