Skip to content

Commit

Permalink
[meta] improve prelint script when no .git dir is present
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 5, 2022
1 parent 64677e0 commit 7c6dbbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -46,7 +46,8 @@
"scripts": {
"prepublishOnly": "safe-publish-latest",
"prepublish": "!(type not-in-publish) || not-in-publish || npm run prepublishOnly",
"prelint": "eclint check $(git ls-files 2>/dev/null | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' || echo '*.md *.js test/*.js')",
"prelint:files": "git ls-files 2>/dev/null | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' || echo '*.md *.js test/*.js'",
"prelint": "FILES=\"$(npm run --silent prelint:files)\" eclint check \"${FILES:=package.json}\"",
"lint": "eslint --ext .js,.cjs,.mjs . bin/*",
"pretest": "npm run lint",
"test": "npm run tests-only",
Expand Down

0 comments on commit 7c6dbbd

Please sign in to comment.