# sublimelinter/sublimelinter-eslint architecture

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

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

## Overview

##### Main Components
- Sublime Text Environment – This is the client user interface where developers open their files.
- SublimeLinter Core – A plugin installed in Sublime Text that calls linter plugins.
- SublimeLinter-eslint Plugin (linter.py) – The heart of this project, written in Python, that bridges SublimeLinter with ESLint.
- ESLint (or eslint_d) – The external linting tool (run via Node.js) that performs static analysis on JavaScript (and other supported) files.
- Node.js Environment – The runtime environment needed to execute ESLint and its plug-ins.
- Configuration & Messaging Files – Including the README, messages directory (with versioned message texts and installation messages) and various config files (.flake8, mypy.ini, etc.), which help set project rules, style guidelines, and enable internationalization.

##### Depicting the Relationships and Interactions
- The Node.js Environment can be illustrated as a container or a module that runs ESLint. Label it accordingly.
- Optionally, display error handling or quick fix flows (e.g., the quick action mapping from SublimeLinter to ESLint fixes).

##### Architectural Patterns and Key Design Principles
- Clearly separate the concerns: the Sublime Text frontend (user interface) versus the linting engine (ESLint) with the plugin acting as the integration layer.
- That the plugin is “pluggable” and can automatically detect local ESLint plugins as per the README. This is crucial for showing dependency on runtime configuration (e.g., local versus global ESLint installations).
- That the system allows for fallbacks: for instance, if eslint_d is present, the plugin prefers that executable.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface
    A("Sublime Text Environment"):::frontend

    %% Linting Core
    B("SublimeLinter Core"):::core

    %% ESLint Integration Plugin
    C("SublimeLinter-eslint Plugin (linter.py)"):::plugin

    %% Lint Execution Environment
    D("ESLint (or eslint_d)"):::eslint
    E("Node.js Environment"):::nodejs

    %% Configuration & Documentation
    subgraph "Configuration & Documentation"
        F("README.md"):::config
        G(".flake8"):::config
        H("mypy.ini"):::config
    end

    %% Localization and Messaging
    I("Localization/Messaging"):::msgs

    %% Flow of Control
    A -->|"initiatesLint"| B
    B -->|"callsPlugin"| C
    C -->|"triggersLint"| D
    D -->|"executesOn"| E
    D -->|"reportsResults"| C
    C -->|"quickFixFeedback"| A

    %% Influence of Configuration and Localization
    F ---|"guidesESLint"| D
    G ---|"guidesESLint"| D
    H ---|"guidesESLint"| D
    I ---|"suppliesMessages"| C

    %% Click Events
    click C "https://github.com/sublimelinter/sublimelinter-eslint/blob/master/linter.py"
    click I "https://github.com/sublimelinter/sublimelinter-eslint/tree/master/messages/"
    click F "https://github.com/sublimelinter/sublimelinter-eslint/blob/master/README.md"
    click G "https://github.com/sublimelinter/sublimelinter-eslint/blob/master/.flake8"
    click H "https://github.com/sublimelinter/sublimelinter-eslint/blob/master/mypy.ini"

    %% Styles
    classDef frontend fill:#f9e79f,stroke:#333,stroke-width:2px;
    classDef core fill:#aed6f1,stroke:#333,stroke-width:2px;
    classDef plugin fill:#fad7a0,stroke:#333,stroke-width:2px;
    classDef eslint fill:#a9dfbf,stroke:#333,stroke-width:2px;
    classDef nodejs fill:#f5b7b1,stroke:#333,stroke-width:2px;
    classDef config fill:#d2b4de,stroke:#333,stroke-width:2px;
    classDef msgs fill:#f7dc6f,stroke:#333,stroke-width:2px;
```
