pugjs / pug-lint

An unopinionated and configurable linter and style checker for Pug
ISC License
228 stars 51 forks source link

Allow to quote file #167

Closed Shinigami92 closed 5 years ago

Shinigami92 commented 5 years ago

When I run yarn pug-lint src/**/*.pug everything is working When I run yarn pug-lint 'src/**/*.pug' the value is used as single file / string and an error throws

yarn run v1.17.3
$ pug-lint 'src/**/*.pug'
/Users/.../node_modules/pug-lint/lib/linter.js:55
      throw new Error('Path ' + filePath + ' was not found');
      ^

Error: Path src/**/*.pug was not found
    at Linter.checkPath (/Users/.../node_modules/pug-lint/lib/linter.js:55:13)
    at /Users/.../node_modules/pug-lint/lib/cli.js:36:35
    at Array.forEach (<anonymous>)
    at run (/Users/.../node_modules/pug-lint/lib/cli.js:35:16)
    at Object.<anonymous> (/Users/.../node_modules/pug-lint/bin/pug-lint:2:22)
    at Module._compile (internal/modules/cjs/loader.js:868:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
    at Module.load (internal/modules/cjs/loader.js:731:32)
    at Function.Module._load (internal/modules/cjs/loader.js:644:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

So now when I add a script into my package.json

{ "scripts": { "lint:pug": "pug-lint src/**/*.pug" } }

the same error occures :( because npm/yarn seams to escape the value best practice is to use { "scripts": { "lint:pug": "pug-lint 'src/**/*.pug'" } } (value is quoted)

Shinigami92 commented 5 years ago

Nevermind... sorry { "scripts": { "lint:pug": "pug-lint src" } } works perfectly