Configuration Reference

Deslint uses a .deslintrc.json file in your project root for configuration. Run npx deslint init to generate one automatically.

Full Schema

{
  "$schema": "https://deslint.com/schema.json",
  "rules": {
    "no-arbitrary-colors": "error",
    "no-arbitrary-spacing": "error",
    "no-arbitrary-typography": "warn",
    "responsive-required": "warn",
    "consistent-component-spacing": "warn",
    "a11y-color-contrast": "error",
    "max-component-lines": "warn",
    "missing-states": "error",
    "dark-mode-coverage": "warn",
    "no-arbitrary-zindex": "error"
  },
  "designSystem": {
    "colors": {
      "brand-navy": "#1E3A5F",
      "brand-gold": "#FFD700"
    },
    "fonts": {
      "body": "Inter",
      "heading": "DM Sans",
      "mono": "JetBrains Mono"
    },
    "spacing": {
      "sm": "0.5rem",
      "md": "1rem",
      "lg": "1.5rem"
    },
    "borderRadius": {
      "default": "8px"
    }
  },
  "ignore": [
    "node_modules/**",
    "dist/**",
    "**/*.test.tsx"
  ],
  "profiles": {
    "prototype": {
      "description": "Relaxed for rapid prototyping",
      "rules": {
        "no-arbitrary-colors": "warn",
        "responsive-required": "off"
      }
    },
    "production": {
      "description": "Strict for shipping",
      "rules": {
        "no-arbitrary-colors": "error",
        "responsive-required": "error"
      }
    }
  }
}

Five Levels of Control

Level 1: Inline Ignore

Suppress a single violation with a mandatory reason:

{/* deslint-ignore no-arbitrary-colors -- brand gradient requires exact hex */}
<div className="bg-[#1E3A5F]" />

Level 2: Rule Configuration

Set severity per rule: "error" | "warn" | "off"

{
  "rules": {
    "no-arbitrary-colors": ["warn", { "allowlist": ["#1E3A5F"] }],
    "responsive-required": "off"
  }
}

Level 3: Design System Definition

Define your team's design tokens. Custom colors become recognized tokens —bg-[#1E3A5F] is suggested as bg-brand-navy.

Level 4: File/Folder Ignore Patterns

Exclude legacy code, test files, or generated output:

{
  "ignore": ["src/legacy/**", "**/*.stories.tsx"]
}

Level 5: Severity Profiles

Switch strictness based on context:

deslint scan --profile production
deslint scan --profile prototype

Tailwind Auto-Import

Deslint automatically reads your Tailwind configuration — no manual token setup needed:

  • Tailwind v3: Reads tailwind.config.js / .ts
  • Tailwind v4: Reads @theme blocks in CSS
  • CSS fallback: Reads :root custom properties

Manual .deslintrc.json tokens override auto-imported ones.