Skip to content

Commit b4cd160

Browse files
committed
More instructions for use are added
1 parent c42970c commit b4cd160

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,35 @@ $ pug-lint [options] <file ...>
2828
* `-c, --config <path>`: [configuration file](#configuration-file) path
2929
* `-r, --reporter <reporter>`: error reporter; console - default, inline
3030

31+
#### Lint multiples files in npm script
32+
33+
First install [glob-exec](https://www.npmjs.com/package/glob-exec)
34+
35+
```shell
36+
npm i -D glob-exec
37+
```
38+
39+
```json
40+
{
41+
"scripts": {
42+
"lint:pug": "glob-exec \"./src/**/*.pug\" -- \"pug-lint {{files.join(' ')}}\""
43+
}
44+
}
45+
```
46+
47+
#### Integrate with [lint-staged](https://www.npmjs.com/package/lint-staged)
48+
49+
```json
50+
{
51+
"lint-staged": {
52+
"{src}/**/*.pug": [
53+
"pug-lint",
54+
"git add"
55+
]
56+
}
57+
}
58+
```
59+
3160
## Editor integration
3261

3362
### Sublime Text 3

0 commit comments

Comments
 (0)