ESLint config optimized for authoring packages that adapts to the project environment, supporting:
To install eslint-config-env
from npm run:
npm install eslint-config-env --save-dev
Configure ESLint in your project:
{
"extends": ["env"]
}
Unfortunately sharable ESLint configs can’t declare their own plugin or config dependencies, so also follow the relevant setup instructions below…
Support for the Node.js environment is required in every project, so also install eslint-plugin-import
and eslint-plugin-node
:
npm install eslint-plugin-import eslint-plugin-node --save-dev
Supported versions of Node.js must be specified in the package.json
engines.node
field.
Also install eslint-plugin-compat
:
npm install eslint-plugin-compat --save-dev
Supported browsers must be specified in the package.json
browserslist
field.
Also install babel-eslint
:
npm install babel-eslint --save-dev
Also install eslint-plugin-prettier
and eslint-config-prettier
:
npm install eslint-plugin-prettier eslint-config-prettier --save-dev
Also install eslint-plugin-react
:
npm install eslint-plugin-react --save-dev
A Next.js project does not require additional setup.