Skip to content

Commit 2065787

Browse files
committedNov 12, 2021
Migrated from husky 4 to 7
1 parent d0d25b5 commit 2065787

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
 

‎.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run pre-commit

‎package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@
221221
"test:grammar-update": "npm run test:grammar-free -- -u && npm run test:grammar-fixed -- -u",
222222
"lint": "eslint . --ext .ts,.tsx",
223223
"lint-fix": "npm run lint -- --fix",
224-
"format": "prettier --write 'src/**/*.{ts,json}' 'test/**/*.ts' 'syntaxes/**/*.json' 'snippets/**/*.json' './**/*.{md,json,yaml,yml}'"
224+
"format": "prettier --write 'src/**/*.{ts,json}' 'test/**/*.ts' 'syntaxes/**/*.json' 'snippets/**/*.json' './**/*.{md,json,yaml,yml}'",
225+
"prepare": "husky install",
226+
"pre-commit": "lint-staged"
225227
},
226228
"devDependencies": {
227229
"@types/glob": "^7.2.0",
@@ -237,18 +239,13 @@
237239
"eslint-plugin-jsdoc": "^37.0.3",
238240
"eslint-plugin-prettier": "^4.0.0",
239241
"glob": "^7.2.0",
240-
"husky": "^7.0.4",
242+
"husky": "^7.0.0",
241243
"lint-staged": "^11.2.6",
242244
"mocha": "^9.1.3",
243245
"prettier": "^2.4.1",
244246
"typescript": "^4.4.4",
245247
"vscode-tmgrammar-test": "^0.0.11"
246248
},
247-
"husky": {
248-
"hooks": {
249-
"pre-commit": "lint-staged"
250-
}
251-
},
252249
"lint-staged": {
253250
"*.ts": [
254251
"npm run format",

0 commit comments

Comments
 (0)
Please sign in to comment.