Configuration
Configure VGuard rules, presets, and adapters.
Config File
import { defineConfig } from '@solanticai/vguard';
export default defineConfig({
presets: ['nextjs-15', 'tailwind', 'supabase'],
agents: ['claude-code', 'cursor'],
rules: {
'security/branch-protection': {
protectedBranches: ['main', 'master', 'staging'],
},
'quality/naming-conventions': false, // Disable a rule
'quality/anti-patterns': { severity: 'warn' },
},
plugins: ['vguard-plugin-example'],
});
Resolution Order
- Rule defaults (lowest priority)
- Presets (applied in declaration order — last preset wins)
- User config (highest priority — always wins)
Supported Formats
| Format | File | Priority |
|---|---|---|
| TypeScript | vguard.config.ts | 1 (highest) |
| JavaScript | vguard.config.js | 2 |
| JSON | .vguardrc.json | 3 |
| package.json | "vguard" field | 4 (lowest) |
Options
presets
Array of preset IDs. See Presets.
agents
Array of AI agents: claude-code (runtime), cursor, codex, opencode (advisory).
rules
Per-rule config. false disables, true enables with defaults, object for custom options.
plugins
Array of npm package names exporting VGuardPlugin.