Add format script to pre-commit hook (#2146)
* Add format script to pre-commit hook * build: add husky prepare step * build: add lint-staged * build: add lint-staged Co-authored-by: rickstaa <rick.staa@outlook.com>
This commit is contained in:
1 parent
bcb8ae9281
commit
e8dfbde7bb
4 files changed
+889
-390
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
_
|
||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npm test
|
||||||
|
npx lint-staged
|
||||||
Generated
+876
-383
File diff suppressed because it is too large.
Load diff
+7
-7
@@ -13,8 +13,9 @@
|
|||||||
"preview-theme": "node scripts/preview-theme",
|
"preview-theme": "node scripts/preview-theme",
|
||||||
"close-stale-theme-prs": "node scripts/close-stale-theme-prs",
|
"close-stale-theme-prs": "node scripts/close-stale-theme-prs",
|
||||||
"generate-langs-json": "node scripts/generate-langs-json",
|
"generate-langs-json": "node scripts/generate-langs-json",
|
||||||
"format": "./node_modules/.bin/prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format:check": "./node_modules/.bin/prettier --check ."
|
"format:check": "prettier --check .",
|
||||||
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"author": "Anurag Hazra",
|
"author": "Anurag Hazra",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -27,10 +28,11 @@
|
|||||||
"axios-mock-adapter": "^1.18.1",
|
"axios-mock-adapter": "^1.18.1",
|
||||||
"color-contrast-checker": "^2.1.0",
|
"color-contrast-checker": "^2.1.0",
|
||||||
"hjson": "^3.2.2",
|
"hjson": "^3.2.2",
|
||||||
"husky": "^4.2.5",
|
"husky": "^8.0.0",
|
||||||
"jest": "^29.0.3",
|
"jest": "^29.0.3",
|
||||||
"jest-environment-jsdom": "^29.0.3",
|
"jest-environment-jsdom": "^29.0.3",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
|
"lint-staged": "^13.0.3",
|
||||||
"lodash.snakecase": "^4.1.1",
|
"lodash.snakecase": "^4.1.1",
|
||||||
"parse-diff": "^0.7.0",
|
"parse-diff": "^0.7.0",
|
||||||
"prettier": "^2.1.2"
|
"prettier": "^2.1.2"
|
||||||
@@ -43,9 +45,7 @@
|
|||||||
"upgrade": "^1.1.0",
|
"upgrade": "^1.1.0",
|
||||||
"word-wrap": "^1.2.3"
|
"word-wrap": "^1.2.3"
|
||||||
},
|
},
|
||||||
"husky": {
|
"lint-staged": {
|
||||||
"hooks": {
|
"*.{js,css,md}": "prettier --write"
|
||||||
"pre-commit": "npm test"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user