Vibrant can be configured using a vibrant.config.js file in your project root.
Creating a config file
Run the init command to create a default configuration:
This generates a vibrant.config.js file with sensible defaults:
module.exports = {
// Directories to ignore during analysis
ignore: ['node_modules', '.git', 'dist', '.next', 'build', 'coverage'],
// Output format: 'pretty', 'compact' or 'plan'
format: 'pretty',
// AI Provider configuration (optional)
// provider: 'openrouter', // 'openai' | 'claude' | 'gemini' | 'ollama' | 'openrouter'
};
Configuration options
ignore
Directories and file patterns to exclude from analysis.
Array of glob patterns to ignore.Default:[
'**/node_modules/**',
'**/.git/**',
'**/dist/**',
'**/build/**',
'**/.next/**',
'**/.turbo/**',
'**/coverage/**',
'**/*.d.ts',
'**/test/**',
'**/tests/**',
'**/__tests__/**'
]
Example:
module.exports = {
ignore: [
'node_modules',
'dist',
'build',
'*.config.js',
'test/**'
]
};
Default output format for analysis results.
Output format type.Values: 'pretty' | 'compact' | 'plan' | 'json'Default: 'pretty'
Example:
module.exports = {
format: 'compact'
};
See Output Formats for examples of each format.
provider
AI provider for enhanced analysis.
AI provider name.Values: 'openai' | 'claude' | 'gemini' | 'ollama' | 'openrouter'Default: Auto-detected from environment variables
Example:
module.exports = {
provider: 'openrouter'
};
rules
Customize which rules to enable and their severity levels.
Rule configuration object.Each rule can be set to:
'error' - Fail the analysis
'warn' - Show warning but don’t fail
'off' - Disable the rule
Default rules:
{
// Type safety
'no-explicit-any': 'error',
// Incomplete code
'unimplemented-error': 'error',
'empty-function-body': 'error',
// Error handling
'empty-catch-block': 'error',
// Security
'hardcoded-credentials': 'error',
// Debug code
'console-log-debugging': 'warn'
}
Example:
module.exports = {
rules: {
'no-explicit-any': 'warn', // Downgrade to warning
'console-log-debugging': 'off', // Disable
'empty-function-body': 'error' // Keep as error
}
};
languageOptions
Configure ECMAScript version and module type.
Language parsing options.Default:{
ecmaVersion: 2022,
sourceType: 'module'
}
Example:
module.exports = {
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module'
}
};
File discovery
Vibrant searches for configuration files in the following order:
vibrant.config.js
vibrant.config.mjs
vibrant.config.cjs
vibrant.config.ts
.vibrantrc
.vibrantrc.js
.vibrantrc.mjs
.vibrantrc.cjs
.vibrantrc.ts
.vibrantrc.json
The search starts in the current directory and walks up to parent directories until a config file is found.
TypeScript config
You can use TypeScript for configuration:
import type { Config } from 'vibrant';
const config: Config = {
ignore: ['node_modules', 'dist'],
format: 'pretty',
rules: {
'no-explicit-any': 'error',
'console-log-debugging': 'warn'
}
};
export default config;
TypeScript configs require Bun to be installed for compilation.
JSON config
Simple JSON configuration is also supported:
{
"ignore": ["node_modules", "dist"],
"format": "pretty",
"rules": {
"no-explicit-any": "error",
"console-log-debugging": "warn"
}
}
Full configuration example
module.exports = {
// Files to analyze (optional - uses defaults if not specified)
files: [
'src/**/*',
'lib/**/*',
'app/**/*'
],
// Patterns to ignore
ignore: [
'node_modules',
'.git',
'dist',
'build',
'.next',
'coverage',
'*.d.ts',
'test/**',
'*.test.ts',
'*.config.js'
],
// Output format
format: 'pretty',
// AI provider
provider: 'openrouter',
// Rule configuration
rules: {
// Type safety
'no-explicit-any': 'error',
// Incomplete code
'unimplemented-error': 'error',
'empty-function-body': 'error',
// Error handling
'empty-catch-block': 'error',
// Security
'hardcoded-credentials': 'error',
'no-sql-injection': 'error',
'no-unsafe-inner-html': 'error',
// Performance
'no-await-in-loop': 'error',
// Possible bugs
'no-unreachable': 'error',
'use-isnan': 'error',
// Debug code
'console-log-debugging': 'warn'
},
// Language options
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module'
}
};