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 this 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
pnpm add -D eslint
Next, install @nish1896/eslint-flat-config
.
npm install @nish1896/eslint-flat-config --save-dev
yarn add -D @nish1896/eslint-flat-config
pnpm add -D @nish1896/eslint-flat-config
Eslint 8
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
yarn add -D eslint@8.57.1`
pnpm add -D eslint@8.57.1`
Next, install @nish1896/eslint-config
.
npm install @nish1896/eslint-config --save-dev
yarn add -D @nish1896/eslint-config
pnpm add -D @nish1896/eslint-config
Setup
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.
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
yarn eslint yourfile.jsx
pnpm eslint yourfile.tsx
This config extends the following plugins -
- @stylistic/eslint-plugin - 2.9.0
- eslint-plugin-react - 7.37.1
- eslint-plugin-react-hooks - 5.0.0
- eslint-plugin-jsx-a11y - 6.10.0
- typescript-eslint - 8.10.0
As of March 15, 2025, the latest version of @stylistic/eslint-plugin is 4.2.0
. Upgrading to this version would introduce breaking changes for both configuration packages.
This migration will be implemented in the next major version update for both packages.