Skip to content

Commit

Permalink
only lint stashed lines
Browse files Browse the repository at this point in the history
git hooks will lint only staged lines
dont use with `--fix` as it can create conflicts
(see lint-staged/lint-staged#62)

Should provide a better DX: one may now commit a file with non staged
lines without having lint complain about unstaged lines
  • Loading branch information
jum-s committed Jan 26, 2023
1 parent 0a083f1 commit a2ad420
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/lint_staged
Expand Up @@ -11,6 +11,8 @@ else
if [ "$1" = "fix" ] || [ "$1" = "--fix" ]; then
echo $staged | xargs npm run lint-fix
else
git stash -k
echo $staged | xargs npm run lint
git stash pop -q
fi
fi

0 comments on commit a2ad420

Please sign in to comment.