How to use Vitest with Git pre commit hook? #1626
-
Dear all =) I would like to create a new project based on this , where I use Vitest instead of Jest. Based on Question What is the recommended way to use Vitest with Git pre commit hooks? Any packages or help will be much appreciated =) Hugs, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This line runs |
Beta Was this translation helpful? Give feedback.
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 usevitest
and husky will run it.