Skip to content

Commit dbd78d7

Browse files
authored
feat: add precommit hook (#191)
* feat: add precommit hook * feat: add precommit hook * feat: add precommit hook * feat: add precommit hook
1 parent ae24c95 commit dbd78d7

File tree

4 files changed

+164
-4
lines changed

4 files changed

+164
-4
lines changed

.eslintignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
.github
1+
.github
2+
pnpm-lock.yaml
3+
node_modules
4+
*.d.ts
5+
coverage
6+
dist
7+
storybook-static
8+
.nuxt

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ dist
3737
.idea
3838

3939
auto-imports.d.ts
40-
components.d.ts
40+
components.d.ts
41+
42+
.eslintcache

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
"dev:all": "turbo run dev --filter='./packages/**' --concurrency $(($(ls -1 packages/components packages/core | wc -l)+3))",
1414
"dev:core": "turbo run dev --filter='./packages/core/**'",
1515
"dev:components": "turbo run dev --filter='./packages/components/**'",
16-
"lint": "eslint .",
17-
"lint:fix": "eslint --fix .",
16+
"lint": "eslint --cache .",
17+
"lint:fix": "eslint --fix --cache .",
1818
"play:vue": "pnpm clean:dts && turbo run dev --filter='./playground/vue3/**'",
1919
"play:nuxt": "pnpm clean:dts && turbo run dev --filter='./playground/nuxt3/**'",
2020
"play": "pnpm clean:dts && turbo run dev --filter='./playground/**'",
21+
"postinstall": "simple-git-hooks",
2122
"test": "vitest run",
2223
"test:watch": "vitest --watch",
2324
"coverage": "vitest run --coverage",
@@ -56,11 +57,13 @@
5657
"eslint-plugin-storybook": "^0.6.12",
5758
"jiti": "^1.18.2",
5859
"jsdom": "^22.1.0",
60+
"lint-staged": "^13.2.3",
5961
"ofetch": "^1.1.1",
6062
"postcss": "^8.4.24",
6163
"react": "^18.2.0",
6264
"react-dom": "^18.2.0",
6365
"rimraf": "^5.0.1",
66+
"simple-git-hooks": "^2.8.1",
6467
"storybook": "^7.0.24",
6568
"storybook-dark-mode": "^3.0.0",
6669
"tailwindcss": "^3.3.2",
@@ -82,5 +85,13 @@
8285
"@vue/runtime-core": "3.3.4",
8386
"vite": "4.3.5"
8487
}
88+
},
89+
"simple-git-hooks": {
90+
"pre-commit": "npx lint-staged"
91+
},
92+
"lint-staged": {
93+
"*.{[jt]s?(x),vue,md}": [
94+
"eslint --cache --fix ."
95+
]
8596
}
8697
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)