Skip to content

Instantly share code, notes, and snippets.

@zsajjad
Last active August 21, 2024 10:56
Show Gist options
  • Save zsajjad/8db1f45eb7bac3279acb573266a404b4 to your computer and use it in GitHub Desktop.
Save zsajjad/8db1f45eb7bac3279acb573266a404b4 to your computer and use it in GitHub Desktop.
Lefthook for React/ReactNative apps
// cSpell:word commitlint typecheck
pre-commit:
parallel: true
commands:
type-check:
glob: '*.{ts,tsx}'
run: yarn typecheck
lint:
glob: '*.{js,ts,jsx,tsx}'
run: yarn lint:eslint:fix {staged_files}
spelling:
glob: '*.{js,ts,jsx,tsx,md}'
run: yarn cspell {staged_files}
markdown-link-check:
glob: '*.md'
run: npx markdown-link-check {staged_files}
commit-msg:
parallel: true
commands:
lint-commit-msg:
run: npx commitlint --edit
spell-check:
run: yarn cspell --no-summary {1}
pre-push:
parallel: true
commands:
test:
run: yarn test
packages-audit:
run: yarn audit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment