eslint-config-recommended

Pluggable ESLint configs for ECMAScript Next, Node.js and React Native that you can import, extend and override

ISC 19 个版本
安装
npm install eslint-config-recommended
yarn add eslint-config-recommended
pnpm add eslint-config-recommended
bun add eslint-config-recommended
README

Pluggable ESLint configs for ECMAScript Next, Node.js and React Native that you can import, extend and override

npm version npm downloads GitHub issues Deps Dev Deps

Usage

In your js project directory:

npm install --save-dev eslint-config-recommended

Choose the configs you want to include in your .eslintrc.yaml:

extends:
  - recommended/esnext
  - recommended/esnext/style-guide
  - recommended/node
  - recommended/node/style-guide
  - recommended/react-native
  - recommended/react-native/style-guide

Alternatively, in your .eslintrc.js or .eslintrc.json:

{
  "extends": ["esnext", "esnext/style-guide", "node", "node/style-guide", "react-native", "react-native/style-guide"]
}

node and react-native extend esnext

node/style-guide and react-native/style-guide extend esnext/style-guide

If you don't need all these configs, you can also install them individually:

To add a git-hook to your commits, consider using husky

npm install --save-dev husky

And in your package.json:

  "scripts": {
    "precommit": "eslint ."
  }

Config

These configs are biased and opinionated, and err on the side of too many rules instead of too few. Think of them as a superset of your repo's lint config, and discard what you don't like in them. It's easy to override and disable the rules you find inconvenient.

版本列表
4.1.0 2020-05-29
4.0.0 2018-09-28
3.0.2 2018-09-28
3.0.1 2018-09-28
3.0.0 2018-06-10
2.0.0 2017-12-09
1.5.0 2016-08-28
1.4.0 2016-08-26
1.3.1 2016-08-08
1.3.0 2016-08-08
1.2.0 2016-08-08
1.1.1 2016-07-19
1.1.0 2016-07-19
1.0.0 2016-07-19
0.1.2 2016-07-18
0.1.1 2016-07-15
0.1.0 2016-07-15
0.0.4 2016-07-14
0.0.3 2016-07-14