Skip to content

Commit cc5c73a

Browse files
authored
refactor: git hooks with linting and tests (#758)
1 parent be37878 commit cc5c73a

File tree

5 files changed

+196
-13
lines changed

5 files changed

+196
-13
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010
indent_style = space
11+
indent_size = 2
1112

1213
[*.json]
1314
indent_style = space

.lintstagedrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"src/**/*.{ts,tsx}": ["eslint", "prettier --write"],
3+
"test/**/*.{ts,tsx}": ["eslint", "prettier --write"]
4+
}

.simple-git-hooks.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"pre-commit": "yarn lint-staged",
3+
"pre-push": "yarn test"
4+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@
6767
"gh-pages": "^3.2.3",
6868
"jest": "^27.2.5",
6969
"jest-canvas-mock": "^2.2.0",
70+
"lint-staged": "^11.2.3",
7071
"microbundle-crl": "^0.13.11",
7172
"prettier": "^2.0.4",
7273
"react": "^17.0.1",
7374
"react-dom": "^17.0.1",
7475
"react-test-renderer": "^17.0.1",
76+
"simple-git-hooks": "^2.6.1",
7577
"typescript": "^4.4.3"
7678
},
7779
"files": [

0 commit comments

Comments
 (0)