Skip to content

Commit 89a88fe

Browse files
authored
Add husky and prettier to format code automatically while committing code (#347)
* Add feature for code formatting when commit * ci skip
1 parent 4519e08 commit 89a88fe

File tree

753 files changed

+8284
-6706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

753 files changed

+8284
-6706
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- run: npm install
2020
- run: npm run build
21-
21+
2222
- name: Deploy
2323
uses: peaceiris/actions-gh-pages@v3
2424
with:

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vuepress/components/BlogPosts.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717

1818
<script>
1919
export default {
20-
name: "BlogPosts",
20+
name: 'BlogPosts',
2121
computed: {
2222
posts() {
2323
return this.$site.pages
2424
.filter((p) => {
25-
return p.path.indexOf("/blog/") >= 0 && p.path != "/blog/";
25+
return p.path.indexOf('/blog/') >= 0 && p.path != '/blog/';
2626
})
2727
.map((p) => {
28-
let path = p.path.replace("/blog/", "");
28+
let path = p.path.replace('/blog/', '');
2929
return { ...p, path: path, date: path.substring(0, 10) };
3030
})
3131
.sort((a, b) => new Date(b.date) - new Date(a.date));

0 commit comments

Comments
 (0)