ESLint config optimized for authoring packages that adapts to the project environment, supporting:
To install eslint-config-env
and it’s peer dependencies with npm, run:
npm install eslint-config-env eslint-plugin-node eslint-plugin-import eslint-plugin-jsdoc --save-dev
Configure ESLint in your project:
{
"extends": ["env"]
}
Also follow the setup instructions that are relevant to your project below…
Every project must specify supported Node.js versions in the package.json
engines.node
field.
If it’s not a Babel project, 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-parser
:
npm install @babel/eslint-parser --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
and eslint-plugin-react-hooks
:
npm install eslint-plugin-react eslint-plugin-react-hooks --save-dev
Follow the Babel setup instructions.
Also install @next/eslint-plugin-next
:
npm install @next/eslint-plugin-next --save-dev
A jsdoc-md
project does not require additional setup.