# yeonjuan/html-eslint architecture

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

- Interactive diagram: https://gitdiagram.com/yeonjuan/html-eslint
- Repository: https://github.com/yeonjuan/html-eslint

## Overview

##### Main Components Identification

- CLI Package (@html-eslint/cli)
- ESLint Plugin (@html-eslint/eslint-plugin)
- Parser (@html-eslint/parser)
- Template Parser (@html-eslint/template-parser)
- Web Linter (@html-eslint/web-linter)
- Website Package (documentation and playground)

**┌─────────────────────────────────────────────┐**
- HTML ESLint Core                 │
- ┬───────────────┬──────────┤
- ESLint Plugin  │    Parser     │ Template │
- Parser  │
- ┴───────────────┴──────────┘

**┌─────────────────┐    ┌─────────────────┐**
- CLI        │    │   Web Linter    │
- ┘    └─────────────────┘

**┌─────────────────────────────────────┐**
- Website                │
- (Documentation + Playground)       │
- ┘

##### Component Relationships

- CLI → ESLint Plugin (uses)
- Web Linter → ESLint Plugin (uses)
- ESLint Plugin → Parser (depends on)
- Parser → Template Parser (uses)
- Website → Web Linter (integrates)

##### Additional Elements

Important elements:
- Rule Definitions (connected to ESLint Plugin)
- Configuration System
- Test Infrastructure
- Documentation Generation Flow

##### Implementation Details

ESLint Plugin:
- Rule Implementation
- Configuration Presets
- HTML AST Handling

Parser:
- HTML Parsing
- AST Generation
- Traversal Utilities

CLI:
- Command Processing
- File Handling
- Report Generation

##### External Integrations

Integration points with:
- ESLint Core
- Editor Integration
- CI/CD Systems

##### The flow from input (HTML files) to output (lint results)

Keep the abstraction level focused on the architectural components while showing enough detail to understand the system's operation and data flow.

- How the different packages interact
- The processing flow of HTML linting
- Integration points for extending the system
- The overall architecture of the HTML ESLint ecosystem

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Integration
        CLI["CLI Package"]:::integration
        WebLinter["Web Linter"]:::integration
    end

    subgraph Core["Core Components"]
        Plugin["ESLint Plugin"]:::core
        Parser["Parser"]:::core
        TemplateParser["Template Parser"]:::core
        
        subgraph PluginComponents["Plugin Components"]
            Rules["Rule Definitions"]:::component
            Config["Configuration System"]:::component
            AST["HTML AST Types"]:::component
            Constants["Core Constants"]:::component
            RuleUtils["Rule Utilities"]:::component
        end
    end

    subgraph UI["User Interface"]
        Website["Website"]:::ui
        Docs["Documentation"]:::ui
        Playground["Playground Interface"]:::ui
    end

    subgraph Testing
        Tests["Test Infrastructure"]:::testing
    end

    %% Relationships
    CLI --> Plugin
    WebLinter --> Plugin
    Plugin --> Parser
    Parser --> TemplateParser
    Website --> WebLinter
    
    %% Plugin Component Relationships
    Plugin --> Rules
    Plugin --> Config
    Plugin --> AST
    Plugin --> Constants
    Rules --> RuleUtils
    
    %% UI Relationships
    Website --> Docs
    Website --> Playground

    %% Testing Relationships
    Tests --> Plugin
    Tests --> Rules

    %% Click Events
    click CLI "https://github.com/yeonjuan/html-eslint/blob/main/packages/cli/lib/cli.js"
    click Plugin "https://github.com/yeonjuan/html-eslint/blob/main/packages/eslint-plugin/lib/index.js"
    click Parser "https://github.com/yeonjuan/html-eslint/blob/main/packages/parser/lib/parser.js"
    click TemplateParser "https://github.com/yeonjuan/html-eslint/blob/main/packages/template-parser/lib/template-parser.js"
    click WebLinter "https://github.com/yeonjuan/html-eslint/blob/main/packages/web-linter/index.js"
    click Website "https://github.com/yeonjuan/html-eslint/tree/main/packages/website/"
    click Rules "https://github.com/yeonjuan/html-eslint/tree/main/packages/eslint-plugin/lib/rules/"
    click Config "https://github.com/yeonjuan/html-eslint/tree/main/packages/eslint-plugin/lib/configs/"
    click Docs "https://github.com/yeonjuan/html-eslint/tree/main/packages/website/src/docs/"
    click Playground "https://github.com/yeonjuan/html-eslint/tree/main/packages/website/src/scripts/playground/"
    click Tests "https://github.com/yeonjuan/html-eslint/tree/main/packages/eslint-plugin/tests/"
    click AST "https://github.com/yeonjuan/html-eslint/blob/main/packages/eslint-plugin/lib/types/ast.d.ts"
    click Constants "https://github.com/yeonjuan/html-eslint/blob/main/packages/eslint-plugin/lib/constants/index.js"
    click RuleUtils "https://github.com/yeonjuan/html-eslint/tree/main/packages/eslint-plugin/lib/rules/utils/"

    %% Styling
    classDef core fill:#2374ab
    classDef integration fill:#57a773
    classDef ui fill:#ff8c42
    classDef component fill:#95b8d1
    classDef testing fill:#8d8d8d

    %% Legend
    subgraph Legend
        CoreLegend["Core Components"]:::core
        IntegrationLegend["Integration Tools"]:::integration
        UILegend["User Interface"]:::ui
        ComponentLegend["Plugin Components"]:::component
        TestingLegend["Testing"]:::testing
    end
```
