# radum/eslint-config architecture

> Architecture diagram of the GitHub repository radum/eslint-config, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/radum/eslint-config
- Repository: https://github.com/radum/eslint-config

## Overview

##### Main Components

a. Core Configuration Layer
- Factory Module (factory.ts)
- Base Configurations
- Plugin Management
- Rule Sets

b. Integration Layer
- Language Support (TypeScript, JavaScript, etc.)
- Framework Support (Vue, React, Svelte, etc.)
- Format Support (CSS, HTML, XML, etc.)

c. CLI Layer
- Command Interface
- Configuration Generator
- File System Operations

**┌─────────────────────────────────────────────────────────────────┐**
- User Project                               │
- ┬─────────────────────────────────┘

**┌───────────────────────────────▼─────────────────────────────────┐**
- Configuration Entry                          │
- (eslint.config.js / eslint.config.mjs)               │
- ┬─────────────────────────────────┘

**┌───────────────────────────────▼─────────────────────────────────┐**
- ESLint Config Factory                        │
- ┬─────────────┬────────────────┬──────────────────┤
- Core Rules │  Plugins    │ Configurations  │    Composers     │
- ┴─────────────┴────────────────┴──────────────────┘

- ┌─────────────────────────────┐

**┌────────────────▼───────┐         ┌──────────▼────────────┐**
- Language Support     │         │   Framework Support    │
- ┤         ├─────────────────────────┤
- JavaScript          │         │ - Vue                   │
- TypeScript          │         │ - React                 │
- JSON/YAML/TOML      │         │ - Svelte               │
- Markdown            │         │ - Astro                 │
- ┘         └─────────────────────────┘

- ┌────────────▼───────────┐
- Format Plugins      │
- ┤
- CSS                │
- HTML               │
- XML                │
- ┘

##### Important Elements

a. Configuration Flow:
- User Config → Factory → Rule Sets → ESLint Engine

b. Plugin System:
- Core Rules ←→ Plugin Manager ←→ External Plugins

c. File Processing Flow:
- Source Files → Parser → Rule Application → Formatting → Output

##### Key Relationships to Highlight

- Factory pattern for configuration composition
- Plugin system integration
- Framework-specific rule sets
- Format handler integrations
- CLI tooling interaction

##### The integration points with various frameworks and tools

This design captures the essence of a modern ESLint configuration system while maintaining clarity about how different components interact and can be extended.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph User["User Project"]
        UC["User Configuration"]
    end

    subgraph Entry["Configuration Entry"]
        CE["eslint.config.js / eslint.config.mjs"]
    end

    subgraph Core["Core Configuration Layer"]
        Factory["Factory Module"]:::core
        Plugins["Plugin Management"]:::core
        BaseConfig["Base Configurations"]:::core
        RuleSets["Rule Sets"]:::core
    end

    subgraph Lang["Language Support"]
        TS["TypeScript"]:::lang
        JS["JavaScript"]:::lang
        JSON["JSON/YAML"]:::lang
        MD["Markdown"]:::lang
    end

    subgraph Frame["Framework Support"]
        Vue["Vue"]:::framework
        React["React"]:::framework
        Svelte["Svelte"]:::framework
        Astro["Astro"]:::framework
        Solid["Solid"]:::framework
    end

    subgraph Format["Format Support"]
        Formatters["Formatters"]:::format
        StyleRules["Style Rules"]:::format
    end

    subgraph CLI["CLI Layer"]
        CMD["Command Interface"]:::cli
        Runner["CLI Runner"]:::cli
        FSOps["File System Operations"]:::cli
        ConfigGen["Configuration Generator"]:::cli
    end

    subgraph Utils["Utility Components"]
        Types["Type Definitions"]:::util
        Constants["Global Constants"]:::util
        UtilFuncs["Utility Functions"]:::util
        Patterns["File Patterns"]:::util
    end

    UC --> CE
    CE --> Factory
    Factory --> BaseConfig
    Factory --> Plugins
    Factory --> RuleSets

    BaseConfig --> Lang
    BaseConfig --> Frame
    BaseConfig --> Format

    Plugins --> Lang
    Plugins --> Frame
    Plugins --> Format

    CMD --> Runner
    Runner --> FSOps
    Runner --> ConfigGen

    %% Component mappings
    click Factory "https://github.com/radum/eslint-config/blob/main/src/factory.ts"
    click Plugins "https://github.com/radum/eslint-config/blob/main/src/plugins.ts"
    click BaseConfig "https://github.com/radum/eslint-config/blob/main/src/configs/index.ts"
    click RuleSets "https://github.com/radum/eslint-config/tree/main/src/configs"
    
    click TS "https://github.com/radum/eslint-config/blob/main/src/configs/typescript.ts"
    click JS "https://github.com/radum/eslint-config/blob/main/src/configs/javascript.ts"
    click JSON "https://github.com/radum/eslint-config/blob/main/src/configs/jsonc.ts"
    click MD "https://github.com/radum/eslint-config/blob/main/src/configs/markdown.ts"
    
    click Vue "https://github.com/radum/eslint-config/blob/main/src/configs/vue.ts"
    click React "https://github.com/radum/eslint-config/blob/main/src/configs/react.ts"
    click Svelte "https://github.com/radum/eslint-config/blob/main/src/configs/svelte.ts"
    click Astro "https://github.com/radum/eslint-config/blob/main/src/configs/astro.ts"
    click Solid "https://github.com/radum/eslint-config/blob/main/src/configs/solid.ts"
    
    click Formatters "https://github.com/radum/eslint-config/blob/main/src/configs/formatters.ts"
    click StyleRules "https://github.com/radum/eslint-config/blob/main/src/configs/stylistic.ts"
    
    click CMD "https://github.com/radum/eslint-config/blob/main/src/cli/index.ts"
    click Runner "https://github.com/radum/eslint-config/blob/main/src/cli/run.ts"
    click FSOps "https://github.com/radum/eslint-config/blob/main/src/cli/stages/update-eslint-files.ts"
    click ConfigGen "https://github.com/radum/eslint-config/blob/main/src/cli/stages/update-package-json.ts"
    
    click Types "https://github.com/radum/eslint-config/blob/main/src/types.ts"
    click Constants "https://github.com/radum/eslint-config/blob/main/src/cli/constants.ts"
    click UtilFuncs "https://github.com/radum/eslint-config/blob/main/src/utils.ts"
    click Patterns "https://github.com/radum/eslint-config/blob/main/src/globs.ts"

    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef lang fill:#4CAF50,stroke:#2E7D32,color:white
    classDef framework fill:#FF9800,stroke:#EF6C00,color:white
    classDef format fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef cli fill:#795548,stroke:#4E342E,color:white
    classDef util fill:#607D8B,stroke:#37474F,color:white
```
