Skip to content

Commit d74c6ca

Browse files
committed
chore: fix lint issue
1 parent ed474bb commit d74c6ca

File tree

6 files changed

+47
-41
lines changed

6 files changed

+47
-41
lines changed

bun.lock

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@stacksjs/clarity": "^0.3.15",
88
"@stacksjs/docs": "^0.70.23",
99
"@stacksjs/eslint-config": "^4.10.2-beta.3",
10+
"@stacksjs/gitlint": "^0.1.5",
1011
"@types/bun": "^1.2.12",
1112
"bumpp": "^10.1.0",
1213
"bun-plugin-dtsx": "^0.21.12",
@@ -495,6 +496,8 @@
495496

496497
"@stacksjs/eslint-plugin": ["@stacksjs/[email protected]", "", { "dependencies": { "@stacksjs/eslint-config": "^4.10.2-beta.1", "@typescript-eslint/utils": "^8.27.0", "@unocss/config": "66.0.0", "@unocss/core": "66.0.0", "magic-string": "^0.30.17", "synckit": "^0.10.0", "unocss": "^66.0.0" } }, "sha512-cPCi9eTeXIXI6RTNvK1QmUFNpT3aTnhLsBXpuD8hs8d+2CSn7mNZBZDn61+Se6nzy3Ot/grKc4uua3uD/+m1cQ=="],
497498

499+
"@stacksjs/gitlint": ["@stacksjs/[email protected]", "", { "bin": { "gitlint": "dist/bin/cli.js" } }, "sha512-5nSr6PN8/cRPdIz9Cj65Dh12N9gR7BPtJzR3rnqhAgpm5q0ihjmVTTybFQqigMcYuRpt2qX4HenV7YXuFOYScw=="],
500+
498501
"@stylistic/eslint-plugin": ["@stylistic/[email protected]", "", { "dependencies": { "@typescript-eslint/utils": "^8.23.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "estraverse": "^5.3.0", "picomatch": "^4.0.2" }, "peerDependencies": { "eslint": ">=9.0.0" } }, "sha512-8hXezgz7jexGHdo5WN6JBEIPHCSFyyU4vgbxevu4YLVS5vl+sxqAAGyXSzfNDyR6xMNSH5H1x67nsXcYMOHtZA=="],
499502

500503
"@surma/rollup-plugin-off-main-thread": ["@surma/[email protected]", "", { "dependencies": { "ejs": "^3.1.6", "json5": "^2.2.0", "magic-string": "^0.25.0", "string.prototype.matchall": "^4.0.6" } }, "sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ=="],

docs/.vitepress/config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { HeadConfig } from 'vitepress'
2-
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
32
import { withPwa } from '@vite-pwa/vitepress'
43
import { defineConfig } from 'vitepress'
54

docs/advanced/configuration.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ git-hooks.config.cjs
1717

1818
# JSON
1919
git-hooks.config.json
20+
```
21+
22+
### Package.json Format
2023

21-
# Package.json
24+
```json
2225
{
23-
"gitHooks": {
26+
"git-hooks": {
2427
"pre-commit": "..."
2528
}
2629
}
@@ -77,9 +80,6 @@ export default getConfig()
7780
// dev.config.ts
7881
import { baseConfig } from './base.config'
7982

80-
// prod.config.ts
81-
import { baseConfig } from './base.config'
82-
8383
export const baseConfig: GitHooksConfig = {
8484
'pre-commit': 'bun run lint',
8585
'commit-msg': 'bun commitlint --edit $1'

docs/api-reference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Or in `package.json`:
116116
117117
```json
118118
{
119-
"gitHooks": {
119+
"git-hooks": {
120120
"pre-commit": "bun run lint"
121121
}
122122
}

docs/features/staged-linting.md

+37-33
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ const config: GitHooksConfig = {
2929

3030
You can use any glob pattern supported by Git:
3131

32-
```ts
32+
```json
3333
{
3434
// Single extension
35-
'*.js': 'eslint --fix',
35+
"*.js": "eslint --fix",
3636

3737
// Multiple extensions
38-
'*.{js,ts,jsx,tsx}': ['eslint --fix', 'prettier --write'],
38+
"*.{js,ts,jsx,tsx}": ["eslint --fix", "prettier --write"],
3939

4040
// Specific directories
41-
'src/**/*.ts': 'tsc --noEmit',
41+
"src/**/*.ts": "tsc --noEmit",
4242

4343
// Exclude patterns
44-
'!(*test).ts': 'eslint'
44+
"!(*test).ts": "eslint"
4545
}
4646
```
4747

@@ -51,17 +51,21 @@ Commands can be specified in two ways:
5151

5252
1. **Single Command String**:
5353

54-
```ts
55-
'*.js': 'eslint --fix'
54+
```json
55+
{
56+
"*.js": "eslint --fix"
57+
}
5658
```
5759

5860
2. **Array of Commands**:
5961

60-
```ts
61-
'*.js': [
62-
'eslint --fix',
63-
'prettier --write'
64-
]
62+
```json
63+
{
64+
"*.js": [
65+
"eslint --fix",
66+
"prettier --write"
67+
]
68+
}
6569
```
6670

6771
## Best Practices
@@ -75,52 +79,52 @@ Commands can be specified in two ways:
7579

7680
### Basic JavaScript/TypeScript Linting
7781

78-
```ts
82+
```json
7983
{
80-
'pre-commit': {
81-
'staged-lint': {
82-
'*.{js,ts}': 'bunx --bun eslint . --fix'
84+
"pre-commit": {
85+
"staged-lint": {
86+
"*.{js,ts}": "bunx --bun eslint . --fix"
8387
}
8488
}
8589
}
8690
```
8791

8892
### Comprehensive Code Quality Checks
8993

90-
```ts
94+
```json
9195
{
92-
'pre-commit': {
93-
'staged-lint': {
96+
"pre-commit": {
97+
"staged-lint": {
9498
// Lint and format TypeScript files
95-
'*.{ts,tsx}': [
96-
'bunx --bun eslint . --fix',
97-
'prettier --write',
98-
'tsc --noEmit'
99+
"*.{ts,tsx}": [
100+
"bunx --bun eslint . --fix",
101+
"prettier --write",
102+
"tsc --noEmit"
99103
],
100104

101105
// Style files
102-
'*.{css,scss}': 'stylelint --fix',
106+
"*.{css,scss}": "stylelint --fix",
103107

104108
// Markdown files
105-
'*.md': 'prettier --write',
109+
"*.md": "prettier --write",
106110

107111
// JSON files
108-
'*.json': 'prettier --write'
112+
"*.json": "prettier --write"
109113
}
110114
}
111115
}
112116
```
113117

114118
### Custom Script Integration
115119

116-
```ts
120+
```json
117121
{
118-
'pre-commit': {
119-
'staged-lint': {
120-
'*.{js,ts}': [
121-
'bun run test:unit',
122-
'bun run lint:fix',
123-
'bun run type-check'
122+
"pre-commit": {
123+
"staged-lint": {
124+
"*.{js,ts}": [
125+
"bun run test:unit",
126+
"bun run lint:fix",
127+
"bun run type-check"
124128
]
125129
}
126130
}

docs/install.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ module.exports = {
129129

130130
```json [package.json]
131131
{
132-
"gitHooks": {
132+
"git-hooks": {
133133
"pre-commit": "bun run lint && bun run test",
134134
"commit-msg": "bun commitlint --edit $1",
135135
"pre-push": "bun run build"

0 commit comments

Comments
 (0)