Skip to content

Commit b2d338b

Browse files
committed
chore: add lint-staged with git hook
1 parent c6eb3cc commit b2d338b

File tree

3 files changed

+267
-3
lines changed

3 files changed

+267
-3
lines changed

.githooks/pre-commit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
npx --no-install lint-staged

package.json

+14
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"espree": "^9.6.1",
103103
"esquery": "^1.5.0",
104104
"json-schema": "^0.4.0",
105+
"lint-staged": "^15.0.0",
105106
"mocha": "^10.2.0",
106107
"monaco-editor": "^0.47.0",
107108
"nyc": "^15.1.0",
@@ -119,5 +120,18 @@
119120
},
120121
"publishConfig": {
121122
"access": "public"
123+
},
124+
"lint-staged": {
125+
"*.{json,md,yml}": [
126+
"prettier --write"
127+
],
128+
"*.{js?(x)}": [
129+
"prettier --write",
130+
"eslint --fix"
131+
],
132+
"*.ts?(x)": [
133+
"prettier --parser=typescript --write",
134+
"eslint --fix"
135+
]
122136
}
123137
}

0 commit comments

Comments
 (0)