Skip to content

Commit 1977516

Browse files
committed
chore: add lefthook for pre-commit linting (#2303)
Closes #2294
1 parent 24a4ae4 commit 1977516

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules
22
.DS_Store
33
.vscode
4-
.idea
4+
.idea
5+
.lefthook-local/
6+
lefthook-local.yml

bun.lock

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

docs/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lefthook.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pre-commit:
2+
parallel: true
3+
commands:
4+
lint:
5+
glob: "*.{js,ts,svelte,json,yml,yaml,md}"
6+
run: bunx biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
7+
stage_fixed: true

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"build:css": "bun scripts/build-css",
3838
"build:docs": "bun scripts/build-docs && bun scripts/format-component-api",
3939
"postinstall": "ibmtelemetry --config=telemetry.yml",
40+
"prepare": "lefthook install",
4041
"release": "standard-version && bun build:docs"
4142
},
4243
"dependencies": {
@@ -56,6 +57,7 @@
5657
"carbon-preprocess-svelte": "^0.11.11",
5758
"culls": "^0.1.1",
5859
"jsdom": "^27.0.1",
60+
"lefthook": "^2.0.1",
5961
"postcss": "^8.5.5",
6062
"sass": "^1.49.11",
6163
"standard-version": "^9.5.0",

0 commit comments

Comments
 (0)