Skip to content

Instantly share code, notes, and snippets.

@NikhilVerma
Created November 9, 2022 05:22
Show Gist options
  • Save NikhilVerma/ecba75d4af2e6dae6f565e1ef40256ea to your computer and use it in GitHub Desktop.
Save NikhilVerma/ecba75d4af2e6dae6f565e1ef40256ea to your computer and use it in GitHub Desktop.
Using pre-push hooks for validation
module.exports = {
"**/*.{ts?(x),vue}": () => "tsc",
"**/*.{ts?(x),vue,js?(x)}": "yarn lint",
"**/*.{vue,ts?(x),js?(x)}": () => "env CI=true yarn test:unit",
"{package.json,yarn.lock}": () => "yarn check --integrity"
};
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# This runs lint-staged on all files which have been changed from the main branch
./node_modules/.bin/lint-staged --diff="origin/main...HEAD" -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment