eslint-config-env
ESLint config optimized for authoring packages that adapts to the project environment, supporting:
Install
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-devConfigure ESLint in your project:
{
"extends": ["env"]
}Also follow the setup instructions that are relevant to your project below…
Node.js
Every project must specify supported Node.js versions in the package.json engines.node field.
Browsers
If it’s not a Babel project, also install eslint-plugin-compat:
npm install eslint-plugin-compat --save-devSupported browsers must be specified in the package.json browserslist field.
Babel
Also install @babel/eslint-parser:
npm install @babel/eslint-parser --save-devPrettier
Also install eslint-plugin-prettier and eslint-config-prettier:
npm install eslint-plugin-prettier eslint-config-prettier --save-devReact
Also install eslint-plugin-react and eslint-plugin-react-hooks:
npm install eslint-plugin-react eslint-plugin-react-hooks --save-devNext.js
Follow the Babel setup instructions.
Also install @next/eslint-plugin-next:
npm install @next/eslint-plugin-next --save-devjsdoc-md
A jsdoc-md project does not require additional setup.