aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Tarek <ahmed.tokyo1@gmail.com>2021-07-29 20:06:12 +0200
committerGitHub <noreply@github.com>2021-07-29 11:06:12 -0700
commit0bac86b0a7cca056da83065e7fb2982b35b1cb02 (patch)
tree62c3f0a7782abb45f1204a02e0033696a29cbf31
parent28b39bd026d1c13150856d84170fe6127288e104 (diff)
🔨 add husky precommit to auto run prettier (#128)
* :sparkles: add husky precommit to auto run prettier * yarn
-rwxr-xr-x.husky/pre-commit5
-rw-r--r--package.json12
-rw-r--r--yarn.lock5
3 files changed, 17 insertions, 5 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 0000000..a03ddbc
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,5 @@
1#!/bin/sh
2. "$(dirname "$0")/_/husky.sh"
3
4# Format using prettier
5make fmt.write
diff --git a/package.json b/package.json
index d043ec8..17a1a93 100644
--- a/package.json
+++ b/package.json
@@ -14,11 +14,16 @@
14 "react-i18next": "^11.11.2", 14 "react-i18next": "^11.11.2",
15 "react-scripts": "^4.0.1" 15 "react-scripts": "^4.0.1"
16 }, 16 },
17 "devDependencies": {
18 "prettier": "2.3.2",
19 "husky": "^7.0.0"
20 },
17 "scripts": { 21 "scripts": {
18 "start": "react-scripts start", 22 "start": "react-scripts start",
19 "build": "react-scripts build", 23 "build": "react-scripts build",
20 "test": "react-scripts test", 24 "test": "react-scripts test",
21 "eject": "react-scripts eject" 25 "eject": "react-scripts eject",
26 "prepare": "husky install"
22 }, 27 },
23 "eslintConfig": { 28 "eslintConfig": {
24 "extends": "react-app" 29 "extends": "react-app"
@@ -38,8 +43,5 @@
38 "main": "index.js", 43 "main": "index.js",
39 "repository": "git@github.com:bndw/wifi-card.git", 44 "repository": "git@github.com:bndw/wifi-card.git",
40 "author": "bndw <ben@bdw.to>", 45 "author": "bndw <ben@bdw.to>",
41 "license": "MIT", 46 "license": "MIT"
42 "devDependencies": {
43 "prettier": "2.3.2"
44 }
45} 47}
diff --git a/yarn.lock b/yarn.lock
index 265ae70..b125637 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5699,6 +5699,11 @@ human-signals@^1.1.1:
5699 resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" 5699 resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
5700 integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== 5700 integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
5701 5701
5702husky@^7.0.0:
5703 version "7.0.1"
5704 resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.1.tgz#579f4180b5da4520263e8713cc832942b48e1f1c"
5705 integrity sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA==
5706
5702i18next-browser-languagedetector@^6.1.2: 5707i18next-browser-languagedetector@^6.1.2:
5703 version "6.1.2" 5708 version "6.1.2"
5704 resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-6.1.2.tgz#68565a28b929cbc98ab6a56826ef2faf0e927ff8" 5709 resolved "https://registry.yarnpkg.com/i18next-browser-languagedetector/-/i18next-browser-languagedetector-6.1.2.tgz#68565a28b929cbc98ab6a56826ef2faf0e927ff8"