generated from yandex-praktikum/client-server-template-with-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlefthook.yml
32 lines (32 loc) · 1.03 KB
/
lefthook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pre-commit:
parallel: true
commands:
lint:misc:
glob: '*.{html,json,yml,md}'
exclude: 'package-lock.json'
run: yarn prettier --write --loglevel warn {staged_files} && git add {staged_files}
lint:css:
glob: '*.{css,pcss}'
run: >
yarn stylelint --fix {staged_files} &&
yarn prettier --write --loglevel warn {staged_files} &&
git add {staged_files}
lint:js:
glob: '*.{ts,tsx}'
exclude: '^(.*)\.(spec|test)\.tsx?'
env:
PRE_COMMIT: true
run: >
yarn eslint --fix --max-warnings=0 {staged_files} &&
yarn prettier --write --loglevel warn {staged_files} &&
yarn jest --bail --findRelatedTests --passWithNoTests {staged_files} &&
git add {staged_files}
test:unit:
glob: '*.{spec,test}.{ts,tsx}'
env:
PRE_COMMIT: true
run: >
yarn eslint --fix {staged_files} &&
yarn prettier --write --loglevel warn {staged_files} &&
yarn jest {staged_files} &&
git add {staged_files}