Skip to content

Commit 3f9ea23

Browse files
committed
build(all): setup prettier formatting in pre-commit hook
1 parent 40c63f3 commit 3f9ea23

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

.huskyrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"hooks": {
3-
"pre-commit": "yarn lint && yarn test",
3+
"pre-commit": "yarn format && yarn lint && yarn test",
44
"commitmsg": "commitlint -e $GIT_PARAMS"
55
}
66
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"lint:js": "eslint '**/*.js'",
1919
"lint:ts": "eslint -c './.eslintrc-ts.js' '**/*.ts'",
2020
"lint": "yarn lint:js; yarn lint:ts",
21+
"format": "prettier scripts src sample/src --write",
2122
"lint:fix": "yarn lint:js --fix; yarn lint:ts --fix",
2223
"start:docs": "docsify serve docs",
2324
"prepare": "husky install"

sample/src/index.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ <h3>Open Service</h3>
306306
<button id="open-service-btn">Open Service</button>
307307
</section>
308308

309-
310309
<section id="logout-section">
311310
<h3>Logout</h3>
312311

@@ -315,6 +314,5 @@ <h3>Logout</h3>
315314
</section>
316315

317316
</div>
318-
319317
</body>
320-
</html>
318+
</html>

sample/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"target": "es5",
77
"lib": ["es6", "es2017", "dom"]
88
}
9-
}
9+
}

0 commit comments

Comments
 (0)