Skip to main content

Overview

The rev-dep config run command processes your .rev-dep.config.json(c) file and executes all enabled checks in a single, optimized pass. This is the recommended way to perform project checks as it’s significantly faster than running individual commands separately.

Syntax

rev-dep config run [flags]

How It Works

The command:
  1. Auto-discovers config file in the current working directory
  2. Builds a single comprehensive dependency tree for all rules
  3. Executes all enabled checks in parallel within each rule
  4. Reports results with detailed issue listings
  5. Exits with code 1 if any check fails

Flags

Core Options

cwd
string
default:"$PWD"
Working directory to run the command from
fix
boolean
default:"false"
Automatically fix all fixable issues. Works for:
  • Import conventions (when autofix is enabled)
  • Unused exports (when autofix is enabled)
  • Orphan files (when autofix is enabled)
list-all-issues
boolean
default:"false"
List all detected issues instead of limiting output to first 5 issues per check
rules
string[]
Subset of rules to run. Provide comma-separated list of rule paths to execute only specific rules from your config

Resolution Options

condition-names
string[]
List of conditions for package.json imports resolution (e.g., node, imports, default)
follow-monorepo-packages
string[]
Enable resolution of imports from monorepo workspace packages. Pass without value to follow all packages, or specify package names to follow only selected ones

Path Configuration

package-json
string
default:"./package.json"
Path to package.json file
tsconfig-json
string
default:"./tsconfig.json"
Path to tsconfig.json file

Output Options

verbose
boolean
default:"false"
Show warnings and verbose output for debugging
help
boolean
Display help information for the run command

Available Checks

The command executes the following checks based on your configuration:
  • circular-imports: Detects circular dependencies between modules
  • orphan-files: Finds files not reachable from any entry point
  • module-boundaries: Enforces architecture boundaries between modules
  • import-conventions: Enforces import style conventions (relative vs absolute)
  • unused-node-modules: Detects dependencies declared but never used
  • missing-node-modules: Detects imports missing from package.json
  • unresolved-imports: Finds imports that cannot be resolved
  • unused-exports: Detects exports that are never imported
  • restricted-dev-dependencies-usage: Finds dev dependencies used in production code
  • restricted-imports: Blocks importing denied files/modules from selected entry points

Examples

Run all configured checks

rev-dep config run

List all issues without truncation

rev-dep config run --list-all-issues

Fix all fixable issues automatically

rev-dep config run --fix

Run specific rules only

rev-dep config run --rules packages/app,packages/lib

Run with monorepo package resolution

rev-dep config run --follow-monorepo-packages

Run specific monorepo packages only

rev-dep config run --follow-monorepo-packages @myorg/utils,@myorg/shared

Run from specific directory

rev-dep config run --cwd ./packages/my-app

Enable verbose output for debugging

rev-dep config run --verbose

Output Format

The command provides detailed output for each rule:
πŸ“ Rule: packages/app (142 files)
  βœ… Circular Dependencies
  ❌ Unresolved Imports (3):
    src/components/Button.tsx
     - @internal/theme
     - ./missing-file
  βœ… Module Boundaries
  βœ… Unused Exports

✨ Done in 289ms.

Issue Listing

By default, only the first 5 issues per check are displayed. Use --list-all-issues to see everything:
rev-dep config run --list-all-issues

Autofix Summary

When using --fix, the command shows a summary of applied fixes:
✍️ Fixed 12 imports in 5 files, removed 3 orphan files

Performance Benefits

The config-based approach provides significant performance advantages:
  • Single Dependency Tree Build: Builds one comprehensive dependency tree for all rules
  • Parallel Rule Execution: Processes multiple rules simultaneously
  • Parallel Check Execution: Runs all enabled checks within each rule in parallel
  • Optimized File Discovery: Discovers files once and reuses across all checks
Rev-dep can audit a 500k+ LoC project in around 500ms, making it 10x-200x faster than alternatives.

Exit Codes

  • 0: All checks passed successfully
  • 1: One or more checks failed with issues

Warnings

The command may display warnings for:
  • No files found: Check if the rule path is correct
  • Missing package.json: Some features may not work without package.json in the rule path
  • Unfixable issues: Inter-domain relative imports that cannot be automatically fixed
  • Import conventions with package.json imports: Support not yet implemented

CI Integration

Add to your CI pipeline to enforce code quality:
# GitHub Actions example
- name: Run dependency checks
  run: npx rev-dep config run
// package.json scripts
{
  "scripts": {
    "check:deps": "rev-dep config run",
    "check:deps:fix": "rev-dep config run --fix"
  }
}
Use --list-all-issues in CI to see all problems at once, reducing feedback cycles.

Build docs developers (and LLMs) love