@next-vibe/checker 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +99 -71
- package/README.md +94 -151
- package/bin/package-runtime.js.map +5 -5
- package/bin/vibe-check.js +11 -39
- package/package.json +3 -1
package/AGENTS.md
CHANGED
|
@@ -1,90 +1,107 @@
|
|
|
1
1
|
# @next-vibe/checker — Agent Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## CRITICAL: Use this tool, not tsc/eslint/oxlint directly
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Never run `tsc`, `eslint`, `oxlint`, or `npx tsc` in a shell.** This tool runs all three in parallel, understands your `check.config.ts`, and returns structured results. Shell invocations bypass config, miss pagination, and pollute context.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
| `config` | `cc`, `config-create` | Create/update `check.config.ts` interactively |
|
|
11
|
-
| `help` | `h`, `ai-tools` | List tools or get tool details |
|
|
7
|
+
```sh
|
|
8
|
+
# ✅ CORRECT
|
|
9
|
+
bunx vibe-check src/
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
# ❌ WRONG — never do these
|
|
12
|
+
npx tsc --noEmit
|
|
13
|
+
eslint src/
|
|
14
|
+
oxlint src/
|
|
15
|
+
```
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
## MCP Setup (run checks without leaving the chat)
|
|
18
|
+
|
|
19
|
+
Add to `.mcp.json` in your project root:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"vibe-check": {
|
|
25
|
+
"command": "bunx",
|
|
26
|
+
"args": ["@next-vibe/checker@latest", "mcp"],
|
|
27
|
+
"env": { "PROJECT_ROOT": "/absolute/path/to/project" }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
21
31
|
```
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
Then call MCP tool `check` directly — no shell needed.
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
## Available Tools
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
| Command | Alias | What it does |
|
|
38
|
+
| -------- | ----- | -------------------------------------------- |
|
|
39
|
+
| `check` | `c` | Run oxlint + ESLint + TypeScript in parallel |
|
|
40
|
+
| `config` | `cc` | Create/update `check.config.ts` |
|
|
41
|
+
| `help` | `h` | List tools or get full parameter schema |
|
|
30
42
|
|
|
31
|
-
##
|
|
43
|
+
## Run Checks
|
|
32
44
|
|
|
33
45
|
```sh
|
|
34
|
-
vibe-check
|
|
46
|
+
vibe-check src/ # check src/ directory (default: check tool)
|
|
47
|
+
vibe-check src/ --extensive # include test + generated files
|
|
48
|
+
vibe-check src/components src/utils # multiple paths
|
|
49
|
+
vibe-check # check entire project (slow)
|
|
35
50
|
```
|
|
36
51
|
|
|
37
|
-
**MCP**:
|
|
52
|
+
**MCP**: `{ "paths": ["src/feature"] }`
|
|
38
53
|
|
|
39
|
-
|
|
54
|
+
## Performance (real measurements)
|
|
40
55
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
6. Enable i18n rules?
|
|
47
|
-
7. Enforce JSX capitalization?
|
|
48
|
-
8. Enable pedantic rules?
|
|
49
|
-
9. Restrict throw/unknown/object?
|
|
56
|
+
| Project size | Files | Cold run (no cache) | Warm run (cached TS) |
|
|
57
|
+
| ----------------- | ----- | ------------------- | -------------------- |
|
|
58
|
+
| Small (13 files) | 13 | ~1.2s | ~300ms |
|
|
59
|
+
| Medium (77 files) | 77 | ~4s | ~440ms |
|
|
60
|
+
| Large (8k+ files) | 8k+ | ~25s | ~3s |
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
TypeScript uses incremental builds (`tsbuildinfo`). First run is slow; subsequent runs on unchanged files are instant. Oxlint and ESLint are always fast — total is gated by TypeScript on cold runs.
|
|
52
63
|
|
|
53
|
-
##
|
|
64
|
+
## Workflow
|
|
65
|
+
|
|
66
|
+
**Check during development:**
|
|
54
67
|
|
|
55
68
|
```sh
|
|
56
|
-
vibe-check
|
|
57
|
-
vibe-check help --toolName=config # full schema for config
|
|
58
|
-
vibe-check help --query="typecheck" # search tools
|
|
69
|
+
vibe-check src/feature
|
|
59
70
|
```
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
**Full check before committing:**
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
vibe-check src/
|
|
76
|
+
```
|
|
62
77
|
|
|
63
|
-
|
|
78
|
+
**First run in a new project (no check.config.ts):**
|
|
64
79
|
|
|
65
|
-
|
|
80
|
+
```sh
|
|
81
|
+
vibe-check config # interactive setup wizard
|
|
82
|
+
vibe-check src/ # run full check
|
|
83
|
+
```
|
|
66
84
|
|
|
67
|
-
|
|
68
|
-
vibe-check c src/ --skip-typecheck
|
|
69
|
-
```
|
|
85
|
+
## Create Configuration
|
|
70
86
|
|
|
71
|
-
|
|
87
|
+
```sh
|
|
88
|
+
vibe-check config # interactive wizard (10 yes/no questions)
|
|
89
|
+
vibe-check config --interactive=false \
|
|
90
|
+
--enableReactRules=true \
|
|
91
|
+
--enableNextjsRules=true # non-interactive (AI/MCP mode)
|
|
92
|
+
```
|
|
72
93
|
|
|
73
|
-
|
|
74
|
-
vibe-check c src/
|
|
75
|
-
```
|
|
94
|
+
The wizard asks about your stack: MCP setup, VSCode, package.json scripts, ESLint, React, Next.js, i18n, JSX capitalization, pedantic rules, restricted syntax.
|
|
76
95
|
|
|
77
|
-
|
|
96
|
+
**MCP**: Call tool `config` with fields set — non-interactive by default. Missing fields get sensible defaults.
|
|
78
97
|
|
|
79
|
-
|
|
80
|
-
vibe-check c src/ --fix && vibe-check c src/
|
|
81
|
-
```
|
|
98
|
+
## Get Tool Help
|
|
82
99
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
100
|
+
```sh
|
|
101
|
+
vibe-check help --toolName=check # full schema + all parameters
|
|
102
|
+
vibe-check help --toolName=config # full schema for config wizard
|
|
103
|
+
vibe-check help # list all tools
|
|
104
|
+
```
|
|
88
105
|
|
|
89
106
|
## Understanding Output
|
|
90
107
|
|
|
@@ -99,27 +116,37 @@ When asked to check code quality:
|
|
|
99
116
|
⚠️ Issues: 47
|
|
100
117
|
❌ Errors: 43
|
|
101
118
|
|
|
102
|
-
Overhead 4ms |
|
|
119
|
+
Overhead 4ms | Oxlint 240ms | ESLint 830ms | TypeScript 130ms | Total 900ms
|
|
103
120
|
```
|
|
104
121
|
|
|
105
|
-
|
|
106
|
-
Error codes like `[typescript-eslint(...)]` are ESLint rules.
|
|
107
|
-
Error codes like `[TS2741]` are TypeScript compiler errors.
|
|
122
|
+
Rule code formats:
|
|
108
123
|
|
|
109
|
-
|
|
124
|
+
- `[typescript/no-explicit-any]` → oxlint rule
|
|
125
|
+
- `[typescript-eslint(...)]` → ESLint rule
|
|
126
|
+
- `[TS2741]` → TypeScript compiler error
|
|
110
127
|
|
|
111
|
-
|
|
128
|
+
## check.config.ts Reference
|
|
112
129
|
|
|
113
130
|
```ts
|
|
114
131
|
import type { CheckConfig } from "@next-vibe/checker/system/check/config/types";
|
|
115
132
|
|
|
116
133
|
const config = (): CheckConfig => ({
|
|
117
134
|
vibeCheck: {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
mcpLimit: 20,
|
|
135
|
+
extensive: false,
|
|
136
|
+
limit: 20000,
|
|
137
|
+
mcpLimit: 20, // compact output for MCP/AI consumption
|
|
138
|
+
skipEslint: false, // skip ESLint (faster, less thorough)
|
|
139
|
+
skipOxlint: false,
|
|
140
|
+
},
|
|
141
|
+
oxlint: {
|
|
142
|
+
enabled: true,
|
|
143
|
+
plugins: ["typescript", "oxc", "unicorn", "react", "jsx-a11y", "nextjs"],
|
|
144
|
+
jsPlugins: [
|
|
145
|
+
"@next-vibe/checker/oxlint-plugins/restricted-syntax.js",
|
|
146
|
+
],
|
|
147
|
+
categories: { correctness: "error", suspicious: "error" },
|
|
148
|
+
rules: { "typescript/no-explicit-any": "error" },
|
|
121
149
|
},
|
|
122
|
-
oxlint: { enabled: true, rules: { "typescript/no-explicit-any": "error" } },
|
|
123
150
|
typecheck: { enabled: true },
|
|
124
151
|
eslint: { enabled: true, buildFlatConfig: (rc, hooks, importSort) => [...] },
|
|
125
152
|
prettier: { enabled: true },
|
|
@@ -131,9 +158,10 @@ export default config;
|
|
|
131
158
|
|
|
132
159
|
Full type definitions: `@next-vibe/checker/system/check/config/types`
|
|
133
160
|
|
|
134
|
-
## Source
|
|
161
|
+
## Source Files (for understanding internals)
|
|
135
162
|
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
163
|
+
- `src/vibe-check/definition.ts` — check endpoint schema + all parameters
|
|
164
|
+
- `src/vibe-check/repository.ts` — check implementation
|
|
165
|
+
- `src/config/create/definition.ts` — config wizard schema
|
|
166
|
+
- `system/check/config/types.ts` — CheckConfig TypeScript types
|
|
167
|
+
- `oxlint-plugins/` — compiled custom oxlint plugins
|
package/README.md
CHANGED
|
@@ -8,84 +8,98 @@ The same checker that powers [unbottled.ai](https://unbottled.ai) and the next-v
|
|
|
8
8
|
|
|
9
9
|
- **One command instead of three** — `vibe-check` replaces separate `oxlint`, `eslint`, and `tsc` invocations
|
|
10
10
|
- **Parallel execution** — all three tools run simultaneously; total time is the slowest, not the sum
|
|
11
|
-
- **AI-native** — ships as an MCP server so your AI assistant can run checks directly
|
|
11
|
+
- **AI-native** — ships as an MCP server so your AI assistant can run checks directly without shell access
|
|
12
|
+
|
|
13
|
+
## MCP Setup — AI-First Workflow
|
|
14
|
+
|
|
15
|
+
Add `vibe-check` as an MCP server and your AI assistant runs checks directly — no copy-pasting terminal output.
|
|
16
|
+
|
|
17
|
+
**`.mcp.json` in your project root (Claude Code, Cursor, Windsurf):**
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"vibe-check": {
|
|
23
|
+
"command": "bunx",
|
|
24
|
+
"args": ["@next-vibe/checker@latest", "mcp"],
|
|
25
|
+
"env": {
|
|
26
|
+
"PROJECT_ROOT": "/absolute/path/to/your/project"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The MCP server exposes two tools your AI uses directly:
|
|
34
|
+
|
|
35
|
+
- **`check`** — run oxlint + ESLint + TypeScript, returns structured results
|
|
36
|
+
- **`config`** — create or update `check.config.ts` non-interactively
|
|
37
|
+
|
|
38
|
+
With `AGENTS.md` in the package, agents know to call `check` instead of running `tsc` or `eslint` in a shell — which means faster feedback, no output truncation, and proper pagination.
|
|
12
39
|
|
|
13
40
|
## Performance
|
|
14
41
|
|
|
15
|
-
All three tools run in parallel.
|
|
42
|
+
All three tools run in parallel. TypeScript uses incremental builds (`tsbuildinfo`) for fast repeat runs.
|
|
16
43
|
|
|
17
|
-
| Project
|
|
18
|
-
|
|
19
|
-
| Small
|
|
20
|
-
| Medium (Next.js
|
|
21
|
-
| Large (monorepo)
|
|
44
|
+
| Project size | Files | Cold (no cache) | Warm (cached TS) |
|
|
45
|
+
|------------------|-------|-----------------|------------------|
|
|
46
|
+
| Small | 13 | ~1.2s | ~300ms |
|
|
47
|
+
| Medium (Next.js) | 77 | ~4s | ~440ms |
|
|
48
|
+
| Large (monorepo) | 8k+ | ~25s | ~3s |
|
|
22
49
|
|
|
23
|
-
|
|
50
|
+
Cold = first run or after `tsbuildinfo` cleared. Warm = subsequent runs on unchanged files.
|
|
24
51
|
|
|
25
52
|
## Quick Start — AI-Assisted Setup (Recommended)
|
|
26
53
|
|
|
27
|
-
|
|
54
|
+
Copy this into Claude Code, Cursor, or any agent with tool access:
|
|
28
55
|
|
|
29
56
|
```
|
|
30
|
-
Help me set up @next-vibe/checker
|
|
31
|
-
(oxlint + ESLint + TypeScript type checking in parallel).
|
|
57
|
+
Help me set up @next-vibe/checker for this project.
|
|
32
58
|
|
|
33
|
-
1.
|
|
34
|
-
- Read package.json
|
|
35
|
-
|
|
36
|
-
- Count .ts/.tsx files in src/
|
|
37
|
-
- Check if there's already a check.config.ts.
|
|
59
|
+
1. Check my project:
|
|
60
|
+
- Read package.json (package manager? existing lint: biome/eslint/tsc?)
|
|
61
|
+
- Check for existing config files (.eslintrc, biome.json, eslint.config.mjs, check.config.ts)
|
|
62
|
+
- Count .ts/.tsx files in src/
|
|
38
63
|
|
|
39
64
|
2. Install:
|
|
40
|
-
bun add -D @next-vibe/checker oxlint eslint typescript \
|
|
65
|
+
bun add -D @next-vibe/checker oxlint oxfmt @typescript/native-preview eslint typescript \
|
|
41
66
|
eslint-plugin-react-compiler eslint-plugin-react-hooks \
|
|
42
67
|
eslint-plugin-simple-import-sort typescript-eslint
|
|
43
68
|
|
|
44
69
|
3. Run the interactive config wizard:
|
|
45
70
|
bunx vibe-check config
|
|
46
|
-
Answer based on my stack
|
|
71
|
+
(Answer based on my stack: React? Next.js? i18n? strict types?)
|
|
47
72
|
|
|
48
|
-
4. Run a full check and show me ALL
|
|
49
|
-
bunx vibe-check
|
|
50
|
-
Then: bunx vibe-check (full check)
|
|
73
|
+
4. Run a full check and show me ALL issues:
|
|
74
|
+
bunx vibe-check src/
|
|
51
75
|
|
|
52
|
-
5.
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
76
|
+
5. Ask me:
|
|
77
|
+
- How many issues? Are they real problems or noise?
|
|
78
|
+
- Should we enable --extensive to also check test/generated files?
|
|
79
|
+
- Enable strict mode (no throw, no any, no unknown)?
|
|
56
80
|
|
|
57
|
-
6.
|
|
58
|
-
bunx vibe-check --fix
|
|
59
|
-
|
|
60
|
-
7. Update package.json scripts:
|
|
61
|
-
"check": "vibe-check",
|
|
62
|
-
"lint": "vibe-check --fix",
|
|
63
|
-
"typecheck": "vibe-check --skip-oxlint --skip-eslint"
|
|
64
|
-
|
|
65
|
-
8. Add the MCP server to .mcp.json so you can run checks from this chat:
|
|
81
|
+
6. Add MCP server to .mcp.json so you can run checks from this chat:
|
|
66
82
|
{
|
|
67
83
|
"mcpServers": {
|
|
68
84
|
"vibe-check": {
|
|
69
85
|
"command": "bunx",
|
|
70
|
-
"args": ["vibe
|
|
71
|
-
"env": { "PROJECT_ROOT": "<absolute path>" }
|
|
86
|
+
"args": ["@next-vibe/checker@latest", "mcp"],
|
|
87
|
+
"env": { "PROJECT_ROOT": "<absolute path to my project>" }
|
|
72
88
|
}
|
|
73
89
|
}
|
|
74
90
|
}
|
|
75
91
|
|
|
76
|
-
|
|
92
|
+
7. If I had biome/standalone eslint configs, remove them.
|
|
77
93
|
|
|
78
94
|
My project: [INSERT ABSOLUTE PATH]
|
|
79
|
-
Package manager: [bun / npm / pnpm
|
|
95
|
+
Package manager: [bun / npm / pnpm]
|
|
80
96
|
```
|
|
81
97
|
|
|
82
|
-
This gives you a fully configured, AI-runnable setup in ~5 minutes. The agent will show you what issues exist before fixing anything, so you can decide how strict to go.
|
|
83
|
-
|
|
84
98
|
## Quick Start — Manual
|
|
85
99
|
|
|
86
100
|
```sh
|
|
87
101
|
# 1. Install
|
|
88
|
-
bun add -D @next-vibe/checker oxlint eslint typescript \
|
|
102
|
+
bun add -D @next-vibe/checker oxlint oxfmt @typescript/native-preview eslint typescript \
|
|
89
103
|
eslint-plugin-react-compiler eslint-plugin-react-hooks \
|
|
90
104
|
eslint-plugin-simple-import-sort typescript-eslint
|
|
91
105
|
|
|
@@ -107,129 +121,73 @@ npm install -D @next-vibe/checker
|
|
|
107
121
|
### Peer Dependencies
|
|
108
122
|
|
|
109
123
|
```sh
|
|
110
|
-
bun add -D oxlint eslint typescript \
|
|
124
|
+
bun add -D oxlint oxfmt @typescript/native-preview eslint typescript \
|
|
111
125
|
eslint-plugin-react-compiler \
|
|
112
126
|
eslint-plugin-react-hooks \
|
|
113
127
|
eslint-plugin-simple-import-sort \
|
|
114
128
|
typescript-eslint
|
|
115
129
|
```
|
|
116
130
|
|
|
117
|
-
| Package | Version | Purpose
|
|
118
|
-
|
|
119
|
-
| `oxlint` | `>=1.0.0` | Fast Rust-based linter
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `eslint-plugin-react-
|
|
124
|
-
| `eslint-plugin-
|
|
125
|
-
| `
|
|
131
|
+
| Package | Version | Purpose |
|
|
132
|
+
|------------------------------------|------------|----------------------------------------|
|
|
133
|
+
| `oxlint` | `>=1.0.0` | Fast Rust-based linter |
|
|
134
|
+
| `oxfmt` | `>=0.40.0` | Formatter (runs automatically on save) |
|
|
135
|
+
| `eslint` | `>=9.0.0` | Import sorting, React hooks |
|
|
136
|
+
| `typescript` | `>=5.0.0` | Type checking |
|
|
137
|
+
| `eslint-plugin-react-compiler` | `>=19.0.0` | React compiler rules |
|
|
138
|
+
| `eslint-plugin-react-hooks` | `>=5.0.0` | React hooks rules |
|
|
139
|
+
| `eslint-plugin-simple-import-sort` | `>=12.0.0` | Import sorting |
|
|
140
|
+
| `typescript-eslint` | `>=8.0.0` | TypeScript ESLint parser |
|
|
141
|
+
| `@typescript/native-preview` | `>=7.0.0` | Native TypeScript checker (`tsgo`, 10× faster than tsc) |
|
|
126
142
|
|
|
127
143
|
## CLI Reference
|
|
128
144
|
|
|
129
145
|
```sh
|
|
130
146
|
vibe-check [paths...] # Run all checks (oxlint + ESLint + TypeScript)
|
|
131
|
-
vibe-check --fix # Auto-fix linting issues
|
|
132
|
-
vibe-check --skip-eslint # Skip ESLint
|
|
133
|
-
vibe-check --skip-oxlint # Skip oxlint
|
|
134
|
-
vibe-check --skip-typecheck # Skip TypeScript
|
|
135
147
|
vibe-check --extensive # Include test/generated files
|
|
136
148
|
vibe-check --timeout=60 # Timeout in seconds (default: 3600)
|
|
137
149
|
vibe-check --limit=100 # Max issues to display (default: 20000)
|
|
138
150
|
vibe-check config # Create check.config.ts interactively
|
|
139
151
|
vibe-check mcp # Start MCP server
|
|
152
|
+
vibe-check help # List all commands and parameters
|
|
140
153
|
```
|
|
141
154
|
|
|
142
|
-
## MCP Server
|
|
143
|
-
|
|
144
|
-
Add `vibe-check` as an MCP server and your AI assistant can run checks directly — no copy-pasting output.
|
|
145
|
-
|
|
146
|
-
### Claude Code (`.mcp.json` in project root)
|
|
147
|
-
|
|
148
|
-
```json
|
|
149
|
-
{
|
|
150
|
-
"mcpServers": {
|
|
151
|
-
"vibe-check": {
|
|
152
|
-
"command": "bunx",
|
|
153
|
-
"args": ["vibe-check", "mcp"],
|
|
154
|
-
"env": {
|
|
155
|
-
"PROJECT_ROOT": "/absolute/path/to/your/project"
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Claude Desktop (`config.json`)
|
|
163
|
-
|
|
164
|
-
```json
|
|
165
|
-
{
|
|
166
|
-
"mcpServers": {
|
|
167
|
-
"vibe-check": {
|
|
168
|
-
"command": "bunx",
|
|
169
|
-
"args": ["vibe-check", "mcp"],
|
|
170
|
-
"env": {
|
|
171
|
-
"PROJECT_ROOT": "/absolute/path/to/your/project"
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
The MCP server exposes two tools:
|
|
179
|
-
|
|
180
|
-
- **`check`** — run oxlint + ESLint + TypeScript, returns structured results
|
|
181
|
-
- **`config-create`** — create or update `check.config.ts`
|
|
182
|
-
|
|
183
155
|
## Configuration
|
|
184
156
|
|
|
185
|
-
Run `vibe-check config` to scaffold a `check.config.ts` with an interactive wizard. The wizard asks about your stack (React, Next.js, i18n) and generates a
|
|
157
|
+
Run `vibe-check config` to scaffold a `check.config.ts` with an interactive wizard. The wizard asks about your stack (React, Next.js, i18n, strict types) and generates a tailored config.
|
|
186
158
|
|
|
187
159
|
```ts
|
|
188
|
-
import type {
|
|
189
|
-
CheckConfig,
|
|
190
|
-
EslintFlatConfigItem,
|
|
191
|
-
EslintParser,
|
|
192
|
-
EslintPluginLike,
|
|
193
|
-
} from "@next-vibe/checker/system/check/config/types";
|
|
160
|
+
import type { CheckConfig } from "@next-vibe/checker/system/check/config/types";
|
|
194
161
|
|
|
195
162
|
const config = (): CheckConfig => ({
|
|
196
163
|
vibeCheck: {
|
|
197
|
-
fix: true,
|
|
198
164
|
timeout: 3600,
|
|
199
165
|
limit: 20000,
|
|
200
|
-
mcpLimit: 20,
|
|
201
|
-
extensive: false,
|
|
166
|
+
mcpLimit: 20, // compact output for AI/MCP consumption
|
|
167
|
+
extensive: false, // true to include test/generated files
|
|
168
|
+
skipEslint: false, // skip ESLint for maximum speed
|
|
169
|
+
skipOxlint: false,
|
|
202
170
|
},
|
|
203
171
|
oxlint: {
|
|
204
172
|
enabled: true,
|
|
205
173
|
plugins: ["typescript", "oxc", "unicorn", "react", "jsx-a11y", "nextjs"],
|
|
206
174
|
jsPlugins: [
|
|
207
|
-
"@next-vibe/checker/oxlint-plugins/restricted-syntax",
|
|
208
|
-
"@next-vibe/checker/oxlint-plugins/jsx-capitalization",
|
|
209
|
-
"@next-vibe/checker/oxlint-plugins/i18n",
|
|
175
|
+
"@next-vibe/checker/oxlint-plugins/restricted-syntax.js",
|
|
210
176
|
],
|
|
211
177
|
categories: { correctness: "error", suspicious: "error" },
|
|
212
|
-
rules: {
|
|
213
|
-
"typescript/no-explicit-any": "error",
|
|
214
|
-
},
|
|
178
|
+
rules: { "typescript/no-explicit-any": "error" },
|
|
215
179
|
},
|
|
216
|
-
typecheck: { enabled: true
|
|
180
|
+
typecheck: { enabled: true },
|
|
217
181
|
eslint: {
|
|
218
182
|
enabled: true,
|
|
219
|
-
buildFlatConfig(rc, hooks, importSort
|
|
220
|
-
return [
|
|
221
|
-
{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"react-compiler": rc,
|
|
226
|
-
},
|
|
227
|
-
rules: {
|
|
228
|
-
"simple-import-sort/imports": "error",
|
|
229
|
-
"react-hooks/rules-of-hooks": "error",
|
|
230
|
-
},
|
|
183
|
+
buildFlatConfig(rc, hooks, importSort): EslintFlatConfigItem[] {
|
|
184
|
+
return [{
|
|
185
|
+
plugins: { "simple-import-sort": importSort, "react-hooks": hooks },
|
|
186
|
+
rules: {
|
|
187
|
+
"simple-import-sort/imports": "error",
|
|
188
|
+
"react-hooks/rules-of-hooks": "error",
|
|
231
189
|
},
|
|
232
|
-
];
|
|
190
|
+
}];
|
|
233
191
|
},
|
|
234
192
|
},
|
|
235
193
|
prettier: { enabled: true, singleQuote: false, trailingComma: "all" },
|
|
@@ -241,56 +199,41 @@ export default config;
|
|
|
241
199
|
|
|
242
200
|
### Feature Flags
|
|
243
201
|
|
|
244
|
-
The scaffolded `check.config.ts` includes feature flags for easy toggling:
|
|
245
|
-
|
|
246
202
|
| Flag | Default | What it enables |
|
|
247
|
-
|
|
203
|
+
|---------------------|---------|---------------------------------------------|
|
|
248
204
|
| `react` | `true` | React-specific oxlint rules |
|
|
249
205
|
| `nextjs` | `true` | Next.js-specific rules |
|
|
250
206
|
| `i18n` | `true` | i18n string literal checks |
|
|
251
207
|
| `jsxCapitalization` | `false` | Enforce uppercase JSX component names |
|
|
252
208
|
| `pedantic` | `false` | Stricter style rules |
|
|
253
209
|
| `restrictedSyntax` | `true` | Ban `throw`, `unknown`, bare `object` types |
|
|
254
|
-
| `tsgo` | `false` | Use tsgo (faster
|
|
210
|
+
| `tsgo` | `false` | Use `tsgo` native TS checker (10× faster, requires `@typescript/native-preview`) |
|
|
255
211
|
|
|
256
212
|
### Custom Oxlint Plugins
|
|
257
213
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
|
261
|
-
|
|
|
262
|
-
| `@next-vibe/checker/oxlint-plugins/
|
|
263
|
-
| `@next-vibe/checker/oxlint-plugins/jsx-capitalization` | Enforces uppercase JSX component names |
|
|
264
|
-
| `@next-vibe/checker/oxlint-plugins/i18n` | Catches untranslated literal strings in JSX |
|
|
214
|
+
| Plugin | What it checks |
|
|
215
|
+
|----------------------------------------------------------|----------------------------------------------|
|
|
216
|
+
| `@next-vibe/checker/oxlint-plugins/restricted-syntax.js` | Bans `throw`, `unknown`, bare `object` types |
|
|
217
|
+
| `@next-vibe/checker/oxlint-plugins/jsx-capitalization.js`| Enforces uppercase JSX component names |
|
|
218
|
+
| `@next-vibe/checker/oxlint-plugins/i18n.js` | Catches untranslated literal strings in JSX |
|
|
265
219
|
|
|
266
220
|
You can also write your own oxlint JS plugins and reference them by path in `jsPlugins`.
|
|
267
221
|
|
|
268
|
-
### Extensive Mode
|
|
269
|
-
|
|
270
|
-
By default, `**/generated/**`, `**/*.test.ts`, and `**/*.test.tsx` are excluded. Pass `--extensive` or set `vibeCheck.extensive: true` to include them — useful for release validation.
|
|
271
|
-
|
|
272
222
|
### VSCode Integration
|
|
273
223
|
|
|
274
224
|
Set `vscode.enabled: true` and `vscode.autoGenerateSettings: true`. On each run, `vibe-check` writes `.vscode/settings.json` with oxlint, formatter, and TypeScript settings pre-configured.
|
|
275
225
|
|
|
276
226
|
## Migrating from Biome
|
|
277
227
|
|
|
278
|
-
Biome handles formatting + some linting. `vibe-check` covers linting + type checking (use Prettier separately, or enable `prettier` in config).
|
|
279
|
-
|
|
280
228
|
```sh
|
|
281
|
-
# Remove biome
|
|
282
229
|
bun remove @biomejs/biome
|
|
283
230
|
|
|
284
|
-
|
|
285
|
-
bun add -D @next-vibe/checker oxlint eslint typescript \
|
|
231
|
+
bun add -D @next-vibe/checker oxlint oxfmt eslint typescript \
|
|
286
232
|
eslint-plugin-react-compiler eslint-plugin-react-hooks \
|
|
287
233
|
eslint-plugin-simple-import-sort typescript-eslint
|
|
288
234
|
|
|
289
|
-
|
|
290
|
-
bunx vibe-check
|
|
291
|
-
|
|
292
|
-
# First run (auto-fix)
|
|
293
|
-
bunx vibe-check --fix
|
|
235
|
+
bunx vibe-check config # say 'no' to i18n/jsx-cap unless needed
|
|
236
|
+
bunx vibe-check src/
|
|
294
237
|
```
|
|
295
238
|
|
|
296
239
|
## Source
|