Last active
May 8, 2018 10:06
-
-
Save mrmartineau/2c845ff8368f754f3406263bd7d931fd to your computer and use it in GitHub Desktop.
Pre-commit stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
scripts: { | |
// ... | |
"precommit": "lint-staged", | |
"lint-staged-stash": "git stash save --keep-index 'lint-staged' && touch .didstash || rm .didstash || true", | |
"lint-staged-stash-pop": "test -f .didstash && rm .didstash && git stash pop || true" | |
}, | |
"lint-staged": { | |
"*.js": ["lint-staged-stash", "eslint --fix", "git add", "lint-staged-stash-pop"] | |
}, | |
// 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment