EDITH

Custom rules

Write project-specific checks in edith.config.json. Pattern, AST, and LLM-backed.

5 min read4 sections

edith.config.json

Drop an edith.config.json at your repo root. EDITH picks it up on every scan and runs your custom rules alongside the built-ins.

json
{
  "$schema": "https://app.edith.expert/schemas/edith-config.json",
  "rules": [
    {
      "id": "team/no-console-in-server",
      "severity": "medium",
      "dimension": "reliability",
      "pattern": "console\\.(log|error|warn)\\(",
      "scope": "app/api/**",
      "message": "Use the structured logger, not console."
    }
  ]
}

Pattern rules

The simplest rule type — a regex pattern that fires per match. Useful for banned imports, deprecated APIs, hardcoded values.

AST rules

For structural checks, target ts-morph node types directly. Example: every fetch call without an AbortSignal.

json
{
  "id": "team/fetch-needs-abort",
  "ast": {
    "kind": "CallExpression",
    "callee": "fetch",
    "missingArg": "AbortSignal"
  }
}

LLM-backed rules

For checks that need reasoning, use prompt — EDITH wraps Claude to evaluate matching files. Use sparingly; costs money per scan.