Skip to content

Architecture

Architecture

Why pre-generate?

  1. No startup cost. The config file is a static array of objects. Nothing gets composed, resolved, or merged at runtime.
  2. Deterministic. The same hash always loads the same config. No plugin loading order surprises.
  3. Snapshot-testable. Generated configs are snapshotted. When a plugin update changes rule defaults, the diff shows exactly what moved.
  4. Inspectable. Open dist/configs/{hash}.js and read what's active. No guessing.

Project structure

src/
  index.ts                Public API (getEslintConfig, rule helpers, hash utils)
  modules.ts              Modular exports for power users
  loader.ts               Dynamic config loader
  hash.ts                 Deterministic bitmask -> SHA-1 hash
  types.ts                Shared TypeScript types
  configs/
    base.ts               ESLint recommended + best practices
    typescript.ts         typescript-eslint (strictTypeChecked)
    ai.ts                 AI mode rules + per-file relaxations
    react.ts              React 19+, Hooks, JSX-A11y (80+ rules via react-compat)
    react-effect.ts       No unnecessary useEffect
    node.ts               Node.js rules and globals
    imports.ts            import-x + unused-imports
    perfectionist.ts      Import/export/structural sorting
    unicorn.ts            Modern JS patterns
    regexp.ts             RegExp quality
    jsdoc.ts              JSDoc validation
    cspell.ts             Spell checking
    sonarjs.ts            Code quality
    security.ts           Security rules
    de-morgan.ts          Boolean expression simplification
    compat.ts             Browser compatibility checking
    json.ts               JSON/JSONC validation
    package-json.ts       package.json validation
    markdown.ts           Markdown/MDX linting
    prettier.ts           Prettier conflict removal
  overrides/
    tests.ts              *.test.{ts,tsx}
    e2e.ts                *.spec.ts
    stories.ts            *.stories.{ts,tsx}
    config-files.ts       *.config.*
    declarations.ts       *.d.ts
    scripts.ts            scripts/**/*
  presets/
    standard.ts           Default limits
  api/
    rule-helpers.ts       Runtime rule manipulation functions
  plugins/
    react-compat.ts       Unified react/ namespace (legacy names for OxLint)
  build/
    config-builder.ts     Validated config builder
    compose.ts            Assembles full config from options
    codegen.ts            Generates ES modules with real imports
    plugin-registry.ts    Maps rule namespaces to imports
    generate.ts           Generates all 16+8 permutations
  oxlint/
    integration.ts        eslint-plugin-oxlint rule disabling