Skip to content

Commit 31e1bc6

Browse files
committed
chore: add husky and lint-staged
1 parent 38ce512 commit 31e1bc6

File tree

7 files changed

+2108
-12
lines changed

7 files changed

+2108
-12
lines changed

‎.husky/commit-msg‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

‎.husky/pre-commit‎

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

‎.lintstagedrc.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports={
2+
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
3+
"biome check --apply-unsafe --no-errors-on-unmatched",
4+
],
5+
"*.{js,ts}": "vitest related --run",
6+
};

‎commitlint.config.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports={extends: ["@commitlint/config-conventional"]};

‎package.json‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,27 @@
44
"description": "",
55
"main": "index.ts",
66
"scripts":{
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "vitest",
8+
"test:coverage": "vitest run --coverage",
9+
"test:ui": "vitest --ui --api 9527",
10+
"format": "biome format ./src",
11+
"lint:ci": "biome ci src",
12+
"prepare": "husky"
813
},
914
"keywords": [],
1015
"author": "",
1116
"license": "ISC",
1217
"devDependencies":{
1318
"@biomejs/biome": "^1.6.4",
19+
"@commitlint/cli": "^19.2.1",
20+
"@commitlint/config-conventional": "^19.1.0",
1421
"@types/node": "^20.12.7",
15-
"typescript": "^5.4.5"
22+
"@vitest/coverage-v8": "^1.5.0",
23+
"@vitest/ui": "^1.5.0",
24+
"husky": "^9.0.11",
25+
"is-ci": "^3.0.1",
26+
"typescript": "^5.4.5",
27+
"vite-tsconfig-paths": "^4.3.2",
28+
"vitest": "^1.5.0"
1629
}
1730
}

0 commit comments

Comments
(0)