Skip to content

Commit a06adfc

Browse files
committed
chore: add format script
1 parent 5dadbb6 commit a06adfc

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

Diff for: package.json

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"scripts": {
3434
"dev": "rollup -c -w",
3535
"build": "tsc -p . --noEmit && rimraf dist && rollup -c",
36+
"format": "sh scripts/format.sh",
3637
"test": "jest",
3738
"test:cov": "jest --coverage && codecov",
3839
"release": "pnpm --parallel exec sh $PWD/scripts/version.sh && sh scripts/release.sh"
@@ -61,6 +62,7 @@
6162
"flush-microtasks": "^1.0.1",
6263
"jest": "^27.2.1",
6364
"prettier": "^2.0.5",
65+
"pretty-quick": "^3.1.1",
6466
"react": "~16.9.0",
6567
"react-dom": "~16.9.0",
6668
"rollup": "^2.43.1",

Diff for: pnpm-lock.yaml

+93
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: scripts/format.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set -e
2+
3+
if [[ `git status --porcelain` ]]; then
4+
echo "Please commit changes first"
5+
exit 1
6+
fi
7+
8+
pnpm m exec pretty-quick
9+
git add -u
10+
git commit --amend --no-edit

0 commit comments

Comments
 (0)