Skip to content

Commit 6f6c08d

Browse files
JLHwungokonet
authored andcommitted
docs(readme): refine prettier examples (#541)
1 parent 5e165a3 commit 6f6c08d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Starting from [v2.0.0](https://github.com/okonet/lint-staged/releases/tag/2.0.0)
199199

200200
## Reformatting the code
201201

202-
Tools like [Prettier](https://prettier.io), ESLint/TSLint, or stylefmt can reformat your code according to an appropriate config by running `prettier --write`/`eslint --fix`/`tslint --fix`. After the code is reformatted, we want it to be added to the same commit. This can be done using following config:
202+
Tools like [Prettier](https://prettier.io), ESLint/TSLint, or stylelint can reformat your code according to an appropriate config by running `prettier --write`/`eslint --fix`/`tslint --fix`/`stylelint --fix`. After the code is reformatted, we want it to be added to the same commit. This can be done using following config:
203203

204204
```json
205205
{
@@ -267,17 +267,23 @@ The following is equivalent:
267267
}
268268
```
269269

270-
### Automatically fix code style with `prettier` for javascript + flow or typescript
270+
### Automatically fix code style with `prettier` for javascript + flow, typescript, markdown or html
271271

272272
```json
273273
{
274-
"*.{js,jsx}": ["prettier --parser flow --write", "git add"]
274+
"*.{js,jsx}": ["prettier --write", "git add"]
275275
}
276276
```
277277

278278
```json
279279
{
280-
"*.{ts,tsx}": ["prettier --parser typescript --write", "git add"]
280+
"*.{ts,tsx}": ["prettier --write", "git add"]
281+
}
282+
```
283+
284+
```json
285+
{
286+
"*.{md,html}": ["prettier --write", "git add"]
281287
}
282288
```
283289

0 commit comments

Comments
 (0)