Skip to content

Commit 5e5bcdb

Browse files
committed
📝 Add installation to README
1 parent 14fdf5c commit 5e5bcdb

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
# wml-coding-std
22
A module for keeping consistent JS coding standards at WML
33

4+
## Installation
5+
First install the package:
6+
```bash
7+
npm i wml-coding-std
8+
```
9+
Then setup appropriate `.eslintrc` file(s) in your project. The [`eslint-config-walmart`](https://github.com/walmartlabs/eslint-config-walmart) package has several options available.
10+
11+
You'll also want to extend `eslint-config-prettier` and `eslint-plugin-react` after extending `eslint-config-walmart` (all included in this package) to make it Prettier-compatible:
12+
```js
13+
{
14+
"extends": [
15+
"walmart",
16+
"prettier",
17+
"prettier/react"
18+
]
19+
}
20+
```
21+
22+
## Rationale
423
Given that we are rapidly adopting prettier to do pure style formatting, we need a new approach to keeping a consistent coding standard. The solution proposed is to create a new module `wml-coding-std`, that does this:
5-
- includes eslint, eslint-config-walmart
24+
- includes eslint, eslint-config-walmart, prettier eslint config overrides
625
- includes prettier
7-
- includes npm postinstall scripts to:
8-
1. setup .eslintrc for the host
9-
2. setup npm tasks for prettier
10-
3. setup git hooks for prettier
26+
- includes npm postinstall scripts to:
27+
1. setup npm tasks for prettier
28+
1. setup git hooks for prettier
1129
- includes a task that user can invoke manually to format all `js,jsx` code under all directories except the usual suspects like `node_modules`, `dist`, `coverage`

0 commit comments

Comments
 (0)