From b4cd1605bea9c6480c1c1347df566a8d19756811 Mon Sep 17 00:00:00 2001 From: Leonardo Gatica Date: Thu, 24 Oct 2019 17:54:34 -0300 Subject: [PATCH] More instructions for use are added --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index cbf9e55..a6bb3a2 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,35 @@ $ pug-lint [options] * `-c, --config `: [configuration file](#configuration-file) path * `-r, --reporter `: error reporter; console - default, inline +#### Lint multiples files in npm script + +First install [glob-exec](https://www.npmjs.com/package/glob-exec) + +```shell +npm i -D glob-exec +``` + +```json +{ + "scripts": { + "lint:pug": "glob-exec \"./src/**/*.pug\" -- \"pug-lint {{files.join(' ')}}\"" + } +} +``` + +#### Integrate with [lint-staged](https://www.npmjs.com/package/lint-staged) + +```json +{ + "lint-staged": { + "{src}/**/*.pug": [ + "pug-lint", + "git add" + ] + } +} +``` + ## Editor integration ### Sublime Text 3