Skip to content

Commit 742fd9d

Browse files
committed
Remove dependencies and update install instrcution
1 parent 70a4b17 commit 742fd9d

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

README.md

+36-4
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,49 @@ ESLint config for WeWork projects. This is an extension of `eslint-config-airbnb
1818

1919
### Install:
2020

21+
**Yarn**
22+
23+
```sh
24+
(
25+
export PKG=eslint-config-wework;
26+
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs yarn add --dev "$PKG@latest"
27+
)
28+
```
29+
30+
**NPM**
31+
32+
If using **npm 5+**, use this shortcut
33+
34+
```sh
35+
npx install-peerdeps --dev eslint-config-wework
2136
```
22-
npm install eslint-config-wework --save
37+
38+
If using **npm < 5**, Linux/OSX users can run
39+
40+
```sh
41+
(
42+
export PKG=eslint-config-wework;
43+
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
44+
)
2345
```
2446

25-
If you're using `npm` < v3 you'll need to install each of this packages `peerDependencies` explicitly.
47+
Which produces and runs a command like:
2648

49+
```sh
50+
npm install --save-dev eslint-config-airbnb eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.# eslint-config-airbnb@^#.#.# eslint-config-lodash@^#.#.# eslint-config-mocha@^#.#.# eslint-config-node@^#.#.# eslint-config-promise@^#.#.# eslint-config-security@^#.#.#
2751
```
28-
npm install eslint-config-airbnb eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y --save
52+
53+
If using **npm < 5**, Windows users can either install all the peer dependencies manually, or use the [install-peerdeps](https://github.com/nathanhleung/install-peerdeps) cli tool.
54+
55+
```sh
56+
npm install -g install-peerdeps
57+
install-peerdeps --dev eslint-config-airbnb
2958
```
59+
The cli will produce and run a command like:
3060

31-
Note: make sure the versions of the above packages that are installed satisfy this package's `peerDependencies`, otherwise you might see inconsistent behavior.
61+
```sh
62+
npm install --save-dev eslint-config-airbnb eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.# eslint-config-airbnb@^#.#.# eslint-config-lodash@^#.#.# eslint-config-mocha@^#.#.# eslint-config-node@^#.#.# eslint-config-promise@^#.#.# eslint-config-security@^#.#.#
63+
```
3264

3365
### Configure:
3466

package.json

-11
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,5 @@
4949
"eslint-plugin-promise": "3.5.0",
5050
"eslint-plugin-react": "7.2.0",
5151
"eslint-plugin-security": "1.4.0"
52-
},
53-
"dependencies": {
54-
"eslint-config-airbnb": "15.1.0",
55-
"eslint-plugin-import": "2.7.0",
56-
"eslint-plugin-jsx-a11y": "5.1.1",
57-
"eslint-plugin-lodash": "2.4.4",
58-
"eslint-plugin-mocha": "4.11.0",
59-
"eslint-plugin-node": "5.1.1",
60-
"eslint-plugin-promise": "3.5.0",
61-
"eslint-plugin-react": "7.2.0",
62-
"eslint-plugin-security": "1.4.0"
6352
}
6453
}

0 commit comments

Comments
 (0)