Skip to content

Commit 0165c13

Browse files
committed
[eslint config] [*] [docs] Added subshell to usage commands and converted samples to the three backtick markdown syntax with language specifier for highlighting.
1 parent 4c8f789 commit 0165c13

File tree

2 files changed

+44
-6
lines changed

2 files changed

+44
-6
lines changed

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

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,41 @@ 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. `PKG=eslint-config-airbnb-base npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$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)
16-
2. add `"extends": "airbnb-base"` to your .eslintrc
15+
1. Ensure packages are installed with correct version numbers by running:
16+
```sh
17+
(
18+
export PKG=eslint-config-airbnb-base;
19+
npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
20+
)
21+
```
22+
23+
Which produces and runs a command like:
24+
25+
```sh
26+
npm install --save-dev eslint-config-airbnb-base eslint@^3.0.1 eslint-plugin-import@^1.10.3
27+
```
28+
29+
2. Add `"extends": "airbnb-base"` to your .eslintrc
1730

1831
### eslint-config-airbnb-base/legacy
1932

2033
Lints ES5 and below. Requires `eslint` and `eslint-plugin-import`.
2134

22-
1. `PKG=eslint-config-airbnb-base npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$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)
23-
2. add `"extends": "airbnb-base/legacy"` to your .eslintrc
35+
1. Ensure packages are installed with correct version numbers by running:
36+
```sh
37+
(
38+
export PKG=eslint-config-airbnb-base;
39+
npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
40+
)
41+
```
42+
43+
Which produces and runs a command like:
44+
45+
```sh
46+
npm install --save-dev eslint-config-airbnb-base eslint@^3.0.1 eslint-plugin-import@^1.10.3
47+
```
48+
49+
2. Add `"extends": "airbnb-base/legacy"` to your .eslintrc
2450

2551
See [Airbnb's overarching ESLint config](https://npmjs.com/eslint-config-airbnb), [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript), and the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information.
2652

packages/eslint-config-airbnb/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,21 @@ 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. `PKG=eslint-config-airbnb npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"` (which produces and runs a command like `npm install --save-dev 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)
16-
2. add `"extends": "airbnb"` to your .eslintrc
15+
1. Ensure packages are installed with correct version numbers by running:
16+
```sh
17+
(
18+
export PKG=eslint-config-airbnb;
19+
npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
20+
)
21+
```
1722

23+
Which produces and runs a command like:
24+
25+
```sh
26+
npm install --save-dev 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
27+
```
28+
29+
2. Add `"extends": "airbnb"` to your .eslintrc
1830
### eslint-config-airbnb/base
1931

2032
This entry point is deprecated. See [eslint-config-airbnb-base](https://npmjs.com/eslint-config-airbnb-base).

0 commit comments

Comments
 (0)