Skip to content

Commit b71f832

Browse files
Add husky and prettier with post-commit formatting hook
1 parent deaf9c3 commit b71f832

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"test": "npm run build && playwright test",
1010
"test:ui": "npm run build && playwright test --ui",
1111
"e2e": "npm run test",
12-
"gh-pages": "git checkout gh-pages && git rebase master && yarn && webpack && git add -f _bundles && git commit -m 'publish gh-pages' && git push origin gh-pages:gh-pages --force && git checkout master"
12+
"format": "prettier --write \"app/**/*.js\" \"tests/**/*.js\" \"*.js\" \"*.json\"",
13+
"gh-pages": "git checkout gh-pages && git rebase master && yarn && webpack && git add -f _bundles && git commit -m 'publish gh-pages' && git push origin gh-pages:gh-pages --force && git checkout master",
14+
"prepare": "husky"
1315
},
1416
"contributors": [
1517
{
@@ -40,6 +42,8 @@
4042
"@babel/preset-env": "^7.14.9",
4143
"@playwright/test": "^1.57.0",
4244
"babel-loader": "^9.1.2",
45+
"husky": "^9.1.7",
46+
"prettier": "^3.7.4",
4347
"serve": "^14.2.5",
4448
"shx": "^0.3.4",
4549
"source-map-loader": "^4.0.1",

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,6 +2472,11 @@ human-signals@^2.1.0:
24722472
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
24732473
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
24742474

2475+
husky@^9.1.7:
2476+
version "9.1.7"
2477+
resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d"
2478+
integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==
2479+
24752480
24762481
version "0.4.24"
24772482
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
@@ -3055,6 +3060,11 @@ preact@~10.4.8:
30553060
resolved "https://registry.yarnpkg.com/preact/-/preact-10.4.8.tgz#8517b106cc5591eb675237c93da99ac052cf4756"
30563061
integrity sha512-uVLeEAyRsCkUEFhVHlOu17OxcrwC7+hTGZ08kBoLBiGHiZooUZuibQnphgMKftw/rqYntNMyhVCPqQhcyAGHag==
30573062

3063+
prettier@^3.7.4:
3064+
version "3.7.4"
3065+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.7.4.tgz#d2f8335d4b1cec47e1c8098645411b0c9dff9c0f"
3066+
integrity sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==
3067+
30583068
private@^0.1.8:
30593069
version "0.1.8"
30603070
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"

0 commit comments

Comments
 (0)