BetaViberTest is in active development — expect breaking changes.
Overview
DocsConfiguration

Configuration

ViberTest works with zero config, but you can customize thresholds, disable rules, and ignore files with a config file.

Initialize Config#

Create a config file in your project root:

Terminalbash
$ vibertest init
# Creates .vibertestrc.json with default settings

Config File Formats#

ViberTest searches for config in the following order (via cosmiconfig):

  1. 1.vibertestrc.json
  2. 2.vibertestrc.yaml
  3. 3.vibertestrc.yml
  4. 4vibertest.config.js
  5. 5vibertest.config.ts

Default Configuration#

This is the full default config. You only need to specify the values you want to change — ViberTest merges your config with these defaults.

.vibertestrc.jsonjson
{
  "rules": {
    "oversized-files": { "enabled": true },
    "god-file": { "enabled": true },
    "bloated-barrel": { "enabled": true },
    "circular-deps": { "enabled": true },
    "separation-of-concerns": { "enabled": true },
    "dead-code": { "enabled": true },
    "code-duplication": { "enabled": true },
    "poor-maintainability": { "enabled": true },
    "missing-error-handling": { "enabled": true },
    "missing-tests": { "enabled": false },
    "style-inconsistency": { "enabled": true },
    "pattern-inconsistency": { "enabled": true },
    "obsolete-patterns": { "enabled": true },
    "unused-deps": { "enabled": true },
    "duplicate-deps": { "enabled": true },
    "hardcoded-secrets": { "enabled": true },
    "ai-smell": { "enabled": true },
    "abandoned-todo": { "enabled": true },
    "security-antipatterns": { "enabled": true },
    "missing-compliance": { "enabled": true },
    "accessibility": { "enabled": true },
    "missing-project-standards": { "enabled": true },
    "missing-production-basics": { "enabled": true },
    "react-performance": { "enabled": false }
  },
  "ignore": [
    "node_modules", "dist", "build",
    ".next", "coverage", ".turbo", ".git"
  ],
  "thresholds": {
    "maxFileLines": 500,
    "maxFunctionLines": 60,
    "maxFunctionParams": 5,
    "maxImports": 20,
    "minTestRatio": 0.05
  }
}

Thresholds#

OptionDefaultDescription
maxFileLines500Maximum lines per file before flagging as oversized
maxFunctionLines60Maximum lines per function before flagging
maxFunctionParams5Maximum function parameters before flagging
maxImports20Maximum imports per file before flagging
minTestRatio0.05Minimum test-to-source file ratio (0-1)

Disabling Rules#

Disable any rule you don't need:

.vibertestrc.jsonjson
{
  "rules": {
    "pattern-inconsistency": { "enabled": false },
    "style-inconsistency": { "enabled": false },
    "react-performance": { "enabled": true }
  }
}

Two rules are disabled by default: react-performance (intentionally noisy) and missing-tests (recently disabled — enable when your team is ready to enforce testing standards).

Ignoring Files#

Add directories or glob patterns to skip during scanning:

.vibertestrc.jsonjson
{
  "ignore": [
    "node_modules", "dist", "build",
    "generated",
    "legacy",
    "**/*.generated.ts"
  ]
}

Default Ignore Patterns#

These directories are always ignored, even without a config file:

node_modulesdistbuild.nextcoverage.turbo.gitvendor*.min.js*.bundle.js

Analyzed File Extensions#

ViberTest analyzes files with these extensions:

.ts.tsx.js.jsx

Real-World Config Examples#

Here are practical configurations for common project types.

React / Next.js Frontend#

Enable React-specific rules, relax file size for pages with lots of JSX:

.vibertestrc.jsonjson
{
  "rules": {
    "react-performance": { "enabled": true },
    "accessibility": { "enabled": true },
    "missing-production-basics": { "enabled": true },
    "missing-compliance": { "enabled": true }
  },
  "thresholds": {
    "maxFileLines": 600,
    "maxFunctionLines": 80,
    "maxImports": 25
  },
  "ignore": [
    "node_modules", "dist", ".next",
    "public", "**/*.config.*"
  ]
}

Node.js API / Backend#

Disable frontend-specific rules, focus on security and architecture:

.vibertestrc.jsonjson
{
  "rules": {
    "react-performance": { "enabled": false },
    "accessibility": { "enabled": false },
    "missing-production-basics": { "enabled": false },
    "security-antipatterns": { "enabled": true },
    "hardcoded-secrets": { "enabled": true },
    "missing-error-handling": { "enabled": true }
  },
  "thresholds": {
    "maxFileLines": 400,
    "maxFunctionLines": 50,
    "maxFunctionParams": 4,
    "minTestRatio": 0.2
  },
  "ignore": [
    "node_modules", "dist", "build",
    "migrations", "seeds", "prisma/generated"
  ]
}

Monorepo (Turborepo / Nx)#

Scan individual packages, ignore shared build artifacts:

packages/web/.vibertestrc.jsonjson
{
  "rules": {
    "react-performance": { "enabled": true }
  },
  "thresholds": {
    "maxFileLines": 600
  },
  "ignore": [
    "node_modules", ".next", ".turbo",
    "dist", "coverage"
  ]
}
packages/api/.vibertestrc.jsonjson
{
  "rules": {
    "react-performance": { "enabled": false },
    "accessibility": { "enabled": false },
    "missing-production-basics": { "enabled": false }
  },
  "thresholds": {
    "maxFunctionLines": 50,
    "minTestRatio": 0.25
  }
}

Run per-package: vibertest scan ./packages/web

Strict Mode (Maximum Quality)#

For teams that want the highest quality bar:

.vibertestrc.jsonjson
{
  "rules": {
    "react-performance": { "enabled": true }
  },
  "thresholds": {
    "maxFileLines": 300,
    "maxFunctionLines": 40,
    "maxFunctionParams": 3,
    "maxImports": 15,
    "minTestRatio": 0.3
  }
}

Legacy Codebase (Gradual Adoption)#

Start with only critical rules, relax thresholds, and tighten over time:

.vibertestrc.jsonjson
{
  "rules": {
    "hardcoded-secrets": { "enabled": true },
    "security-antipatterns": { "enabled": true },
    "missing-tests": { "enabled": true },
    "dead-code": { "enabled": true },
    "oversized-files": { "enabled": true },
    "style-inconsistency": { "enabled": false },
    "pattern-inconsistency": { "enabled": false },
    "obsolete-patterns": { "enabled": false },
    "ai-smell": { "enabled": false },
    "abandoned-todo": { "enabled": false },
    "missing-project-standards": { "enabled": false },
    "missing-production-basics": { "enabled": false }
  },
  "thresholds": {
    "maxFileLines": 1000,
    "maxFunctionLines": 120,
    "maxFunctionParams": 8,
    "maxImports": 30,
    "minTestRatio": 0.05
  },
  "ignore": [
    "node_modules", "dist", "build",
    "legacy", "vendor", "migrations"
  ]
}