Skip to content

Commit 2c481ed

Browse files
ljharbhibearpanda
authored andcommitted
[eslint config] [*] [docs] update the peer dep install command to dynamically look up the right version numbers when installing peer deps.
Fixes airbnb#956. This command would be simpler if npm/npm#11213 is ever implemented.
1 parent a3bea85 commit 2c481ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/eslint-config-airbnb-base/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We export two ESLint configurations for your usage.
1212

1313
Our default export contains all of our ESLint rules, including ECMAScript 6+. It requires `eslint` and `eslint-plugin-import`.
1414

15-
1. `npm install --save-dev eslint-config-airbnb-base eslint-plugin-import eslint`
15+
1. `PKG=eslint-config-airbnb-base npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install "$PKG"` (which produces and runs a command like `npm install --save-dev eslint-config-airbnb-base eslint@^3.0.1 eslint-plugin-import@^1.10.3` but with whatever the proper version numbers are)
1616
2. add `"extends": "airbnb-base"` to your .eslintrc
1717

1818
### eslint-config-airbnb-base/legacy

packages/eslint-config-airbnb/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We export three ESLint configurations for your usage.
1212

1313
Our default export contains all of our ESLint rules, including ECMAScript 6+ and React. It requires `eslint`, `eslint-plugin-import`, `eslint-plugin-react`, and `eslint-plugin-jsx-a11y`.
1414

15-
1. `npm install --save-dev eslint-config-airbnb eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y eslint`
15+
1. `PKG=eslint-config-airbnb npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install "$PKG"` (which produces and runs a command like `npm install eslint-config-airbnb eslint@^2.9.0 eslint-plugin-jsx-a11y@^1.2.0 eslint-plugin-import@^1.7.0 eslint-plugin-react@^5.0.1` but with whatever the proper version numbers are)
1616
2. add `"extends": "airbnb"` to your .eslintrc
1717

1818
### eslint-config-airbnb/base

0 commit comments

Comments
 (0)