Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add pre-commit and run prettier in it #386

Merged
merged 7 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Related issues:

- [ ] I have read the [CONTRIBUTING](https://github.com/hypertrons/hypertrons-crx/blob/master/CONTRIBUTING.md) doc
- [ ] I have signed the [CLA](https://cla-assistant.io/hypertrons/hypertrons-crx)
- [ ] I have run `yarn run prettier` before creating this PR

## Others
<!-- Other information you want to share. -->
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run pretty-quick:check
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"start": "node utils/server.js",
"deploy": "node scripts/deploy.js",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss}\"",
"prettier:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss}\""
"prettier:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,scss}\"",
"pretty-quick:check": "pretty-quick --staged --check --pattern \"**/*.{js,jsx,ts,tsx,json,css,scss}\"",
"prepare": "husky install"
},
"dependencies": {
"@antv/g6": "^4.6.4",
Expand Down Expand Up @@ -50,8 +52,10 @@
"fs-extra": "^10.0.0",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.1",
"mkdirp": "^1.0.4",
"prettier": "^2.6.2",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"querystring": "^0.2.1",
"sass": "^1.52.1",
"sass-loader": "^12.4.0",
Expand Down
Loading