Skip to content

Commit 98d264d

Browse files
committed
feat: add prettier and nano-staged for code formatting
1 parent a149236 commit 98d264d

File tree

5 files changed

+61
-6
lines changed

5 files changed

+61
-6
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm nano-staged

adex/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
101101
"scripts": {
102102
"next": "bumpp",
103103
"test": "glob -c 'node --test --test-reporter=spec' tests/**/*.spec.js",
104-
"test:ci": "c8 pnpm test"
104+
"test:ci": "c8 pnpm test",
105+
"fix": "prettier --write ."
105106
},
106107
"dependencies": {
107108
"@barelyhuman/tiny-use": "^0.0.2",
@@ -120,13 +121,16 @@
120121
},
121122
"devDependencies": {
122123
"@barelyhuman/node-snapshot": "^1.0.2",
124+
"@barelyhuman/prettier-config": "^1.1.0",
123125
"@preact/preset-vite": "^2.8.2",
124126
"@types/node": "^20.14.10",
125127
"adex-adapter-node": "^0.0.17",
126128
"autoprefixer": "^10.4.19",
127129
"c8": "^10.1.3",
128130
"glob": "^11.0.1",
129131
"kolorist": "^1.8.0",
132+
"nano-staged": "^0.8.0",
133+
"prettier": "^3.5.3",
130134
"tailwindcss": "^3.4.4",
131135
"vite": "^5.3.1"
132136
},
@@ -139,5 +143,6 @@
139143
"@preact/preset-vite": ">=2.8.2",
140144
"adex-adapter-node": ">=0.0.15",
141145
"preact": "^10.22.0"
142-
}
146+
},
147+
"prettier": "@barelyhuman/prettier-config"
143148
}

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"test:ci": "pnpm -r test:ci",
1313
"publish:ci": "lerna publish from-git --registry 'https://registry.npmjs.org' --yes",
1414
"next": "bumpp -r",
15-
"nuke": "pnpm -r exec rm -rvf node_modules"
15+
"nuke": "pnpm -r exec rm -rvf node_modules",
16+
"fix": "pnpm -r run --if-present fix",
17+
"prepare": "husky"
1618
},
1719
"license": "MIT",
1820
"prettier": "@barelyhuman/prettier-config",
@@ -21,8 +23,15 @@
2123
"@lerna-lite/cli": "^4.0.0",
2224
"@lerna-lite/publish": "^4.0.0",
2325
"bumpp": "^9.4.1",
26+
"husky": "^9.1.7",
27+
"nano-staged": "^0.8.0",
2428
"prettier": "^3.5.3"
2529
},
30+
"nano-staged": {
31+
"*.{js,md,ts,json}": [
32+
"prettier --write"
33+
]
34+
},
2635
"pnpm": {
2736
"overrides": {
2837
"cross-spawn@>=7.0.0 <7.0.5": ">=7.0.5"

playground/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
"preact": "^10.24.2"
1818
},
1919
"devDependencies": {
20+
"@barelyhuman/prettier-config": "^1.1.0",
2021
"@preact/preset-vite": "^2.9.1",
2122
"@tailwindcss/forms": "^0.5.9",
2223
"@types/node": "^20.16.10",
2324
"adex": "workspace:*",
2425
"autoprefixer": "^10.4.20",
2526
"postcss": "^8.4.47",
27+
"prettier": "^3.5.3",
2628
"tailwindcss": "^3.4.13",
2729
"vite": "^5.4.8"
28-
}
30+
},
31+
"prettier": "@barelyhuman/prettier-config"
2932
}

pnpm-lock.yaml

Lines changed: 39 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)