You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,19 @@ Supported are any executables installed locally or globally via `npm` as well as
166
166
167
167
Pass arguments to your commands separated by space as you would do in the shell. See [examples](#examples) below.
168
168
169
-
Starting from [v2.0.0](https://github.com/okonet/lint-staged/releases/tag/2.0.0) sequences of commands are supported. Pass an array of commands instead of a single one and they will run sequentially. This is useful for running autoformatting tools like `eslint --fix` or `stylefmt` but can be used for any arbitrary sequences.
169
+
## Running multiple commands in a sequence
170
+
171
+
You can run multiple commands in a sequence on every glob. To do so, pass an array of commands instead of a single one. This is useful for running autoformatting tools like `eslint --fix` or `stylefmt` but can be used for any arbitrary sequences.
172
+
173
+
For example:
174
+
175
+
```json
176
+
{
177
+
"*.js": ["eslint", "prettier --write"]
178
+
}
179
+
```
180
+
181
+
going to execute `eslint` and if it exits with `0` code, it will execute `prettier --write` on all staged `*.js` files.
170
182
171
183
## Using JS functions to customize tasks
172
184
@@ -332,23 +344,11 @@ For example, here is `jest` running on all `.js` files with the `NODE_ENV` varia
332
344
}
333
345
```
334
346
335
-
### Automatically fix code style with `prettier` for javascript + flow, typescript, markdown or html
336
-
337
-
```json
338
-
{
339
-
"*.{js,jsx}": "prettier --write"
340
-
}
341
-
```
342
-
343
-
```json
344
-
{
345
-
"*.{ts,tsx}": "prettier --write"
346
-
}
347
-
```
347
+
### Automatically fix code style with `prettier` for javascript, typescript, markdown, HTML, or CSS
0 commit comments