Skip to content

How to use Vitest with Git pre commit hook? #1626

Answered by Demivan
littlesandra88 asked this question in Q&A
Discussion options

You must be logged in to vote

jest in .eslintrc is for eslint rules. This is because jest uses global imports that eslint does not like.
If you don't have globals enabled with Vitest you do not need eslint rules.

This line runs test script as a pre-commit hook:
https://github.com/stemmlerjs/simple-typescript-starter/blob/3b1fb5311aa6bc9dc8dbbc7749c9d3022a43d897/package.json#L24
You only need to change test script to use vitest and husky will run it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nickserv
Comment options

Answer selected by littlesandra88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants