Skip to content

Commit aeef386

Browse files
committed
chore: adds pre-commit with build and lint
1 parent 5c93e44 commit aeef386

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run build
5+
npm run lint
6+

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
"lint": "eslint .",
3131
"test": "vitest src/*.test.ts",
3232
"build": "echo \"\" > ./build-complete.meta && tsc",
33+
"prepublish": "npm run build",
3334
"coverage": "vitest --coverage",
34-
"install": "( [ -f ./git-package.meta ] && [ ! -f ./build-complete.meta ] && echo \"\" > ./build-complete.meta && npm install . && tsc ) || echo \"\" > ./build-complete.meta"
35+
"install": "( [ -f ./git-package.meta ] && [ ! -f ./build-complete.meta ] && echo \"\" > ./build-complete.meta && npm install . && tsc ) || echo \"\" > ./build-complete.meta",
36+
"prepare": "husky install"
3537
},
3638
"dependencies": {
3739
"through": "^2.3.8"
@@ -45,6 +47,7 @@
4547
"eslint": "^8.19.0",
4648
"eslint-config-prettier": "^8.5.0",
4749
"eslint-plugin-prettier": "^4.2.1",
50+
"husky": "^8.0.1",
4851
"node-fetch": "^3.2.6",
4952
"prettier": "^2.7.1",
5053
"typescript": "^4.7.4",

tsconfig.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"compilerOptions": {
3-
"declaration": true,
4-
"declarationMap": true,
5-
"lib": ["esnext"],
6-
"target": "es2020",
7-
"module": "commonjs",
8-
"outDir": "dist",
9-
"rootDir": "src",
10-
"strict": true,
11-
"noImplicitAny": true,
12-
"esModuleInterop": true,
13-
"skipLibCheck": true,
14-
"forceConsistentCasingInFileNames": true,
15-
"types": ["node", "jest", "node-fetch"],
16-
"allowJs": true,
17-
"checkJs": false
18-
},
19-
"include": ["src"]
2+
"compilerOptions": {
3+
"declaration": true,
4+
"declarationMap": true,
5+
"lib": ["esnext"],
6+
"target": "es2020",
7+
"module": "commonjs",
8+
"outDir": "dist",
9+
"rootDir": "src",
10+
"strict": true,
11+
"noImplicitAny": true,
12+
"esModuleInterop": true,
13+
"skipLibCheck": true,
14+
"forceConsistentCasingInFileNames": true,
15+
"types": ["node", "vitest/globals", "node-fetch"],
16+
"allowJs": true,
17+
"checkJs": false
18+
},
19+
"include": ["src"]
2020
}

0 commit comments

Comments
 (0)