Skip to content

Commit 987d76a

Browse files
authored
chore(deps, lint): add lint with husky and lint-staged (#18)
1 parent 1d43efa commit 987d76a

File tree

3 files changed

+316
-19
lines changed

3 files changed

+316
-19
lines changed

.husky/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
5+
yarn run lint-staged
6+
yarn run build
7+
yarn run test

package.json

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"author": "ri7nz <[email protected]>",
1313
"license": "MIT",
1414
"homepage": "https://rescript-chakra.vercel.app/",
15+
"publishConfig": {
16+
"access": "public"
17+
},
1518
"files": [
1619
"src/**/*.re",
1720
"src/**/*.rei",
@@ -32,32 +35,47 @@
3235
"semantic-release": "semantic-release",
3336
"ci": "yarn install --immutable",
3437
"pretest": "yarn build",
35-
"test": "jest"
38+
"test": "jest",
39+
"postinstall": "husky install",
40+
"prepublishOnly": "pinst --disable",
41+
"postpublish": "pinst --enable"
3642
},
37-
"publishConfig": {
38-
"access": "public"
43+
"jest": {
44+
"verbose": true,
45+
"testPathIgnorePatterns": [
46+
"/node_modules/",
47+
"/testUtils/"
48+
],
49+
"coveragePathIgnorePatterns": [
50+
"/node_modules/",
51+
"/testUtils/"
52+
]
53+
},
54+
"prettier": {
55+
"trailingComma": "all"
56+
},
57+
"lint-staged": {
58+
"*.{md,json,js}": [
59+
"prettier --write"
60+
],
61+
"*.{res,resi}": [
62+
"bsrefmt --in-place"
63+
]
3964
},
4065
"devDependencies": {
4166
"@glennsl/bs-jest": "0.7.0",
4267
"@rescript/react": "0.10.3",
68+
"husky": "7.0.2",
4369
"jest": "26.6.3",
70+
"lint-staged": "11.1.2",
71+
"pinst": "2.1.6",
72+
"prettier": "2.4.1",
4473
"rescript": "9.1.4",
4574
"semantic-release": "17.4.4",
4675
"semantic-release-npm-github-publish": "1.4.0"
4776
},
4877
"peerDependencies": {
4978
"@chakra-ui/react": ">=1.6.3",
5079
"@rescript/react": "0.10.3"
51-
},
52-
"jest": {
53-
"verbose": true,
54-
"testPathIgnorePatterns": [
55-
"/node_modules/",
56-
"/testUtils/"
57-
],
58-
"coveragePathIgnorePatterns": [
59-
"/node_modules/",
60-
"/testUtils/"
61-
]
6280
}
6381
}

0 commit comments

Comments
 (0)