Skip to content

Instantly share code, notes, and snippets.

@mrmartineau
Last active May 8, 2018 10:06
Show Gist options
  • Save mrmartineau/2c845ff8368f754f3406263bd7d931fd to your computer and use it in GitHub Desktop.
Save mrmartineau/2c845ff8368f754f3406263bd7d931fd to your computer and use it in GitHub Desktop.
Pre-commit stuff
// 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