# flint-fyi/flint architecture

> Architecture diagram of the GitHub repository flint-fyi/flint, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/flint-fyi/flint
- Repository: https://github.com/flint-fyi/flint

## Overview

Flint is an experimental hybrid linter: users invoke its CLI to lint a repository, optionally watch for changes, apply fixes, and view reports. The repository separates orchestration and linting mechanics in a shared core from language adapters and rule plugins, with CLI renderers presenting results. The README also calls out readable configuration, type-aware caching, and a unified rule core. Some subsystem links are dashed because the supplied excerpts do not show their runtime wiring; the graph does not assume those calls.

Main entry points: [`packages/core/src`](https://github.com/flint-fyi/flint/tree/main/packages/core/src) (Lint core), [`packages/cli/src/runCli.ts`](https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCli.ts) (CLI entry), [`packages/core/src/languages`](https://github.com/flint-fyi/flint/tree/main/packages/core/src/languages) (Language runtime), [`packages/astro-language/src/language.ts`](https://github.com/flint-fyi/flint/blob/main/packages/astro-language/src/language.ts) (Other languages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_cli["CLI entry<br/>[runCli.ts]"]
  node_once["Single run<br/>[runCliOnce.ts]"]
  node_watch["Watch run<br/>[runCliWatch.ts]"]
  node_renderer["Output renderers"]
  node_presenter["Report presenters"]
end

subgraph group_engine["Linting engine"]
  node_core["Lint core"]
  node_config["Configuration"]
  node_hosts["File hosts"]
  node_cache[("Lint cache")]
  node_changes["Fixes and changes"]
  node_reports["Reports and directives"]
end

subgraph group_languages["Language support"]
  node_langcore["Language runtime"]
  node_tslang["TypeScript language"]
  node_volarlang["Volar languages<br/>[language.ts]"]
  node_otherlangs["Other languages<br/>[language.ts]"]
end

subgraph group_plugins["Rule plugins"]
  node_tsplugin["TypeScript rules<br/>[plugin.ts]"]
  node_browser["Browser rules<br/>[plugin.ts]"]
  node_astro["Astro rules<br/>[plugin.ts]"]
  node_jsonrules["JSON rules<br/>[plugin.ts]"]
  node_mdrules["Markdown rules<br/>[plugin.ts]"]
  node_otherrules["Additional plugins"]
end

node_user(("Developer"))

node_user -->|"invokes"| node_cli
node_cli -->|"runs once"| node_once
node_cli -->|"starts watch"| node_watch
node_cli -->|"creates renderer"| node_renderer
node_once -->|"runs lint"| node_core
node_watch -->|"reruns lint"| node_once
node_renderer -->|"selects presenter"| node_presenter
node_core -.->|"loads configuration"| node_config
node_core -.->|"uses file host"| node_hosts
node_core -.->|"caches results"| node_cache
node_core -.->|"applies fixes"| node_changes
node_core -.->|"produces reports"| node_reports
node_core -.->|"runs language visitors"| node_langcore
node_langcore -.->|"uses services"| node_tslang
node_langcore -.->|"supports Volar"| node_volarlang
node_langcore -.->|"supports languages"| node_otherlangs
node_tsplugin -->|"creates rules"| node_core
node_browser -->|"analyzes syntax"| node_tslang
node_astro -->|"uses Astro language"| node_otherlangs
node_jsonrules -.->|"uses JSON language"| node_otherlangs
node_mdrules -.->|"uses Markdown language"| node_otherlangs
node_otherrules -.->|"extends core"| node_core

click node_cli "https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCli.ts"
click node_once "https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCliOnce.ts"
click node_watch "https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCliWatch.ts"
click node_renderer "https://github.com/flint-fyi/flint/tree/main/packages/cli/src/renderers"
click node_presenter "https://github.com/flint-fyi/flint/tree/main/packages/cli/src/presenters"
click node_core "https://github.com/flint-fyi/flint/tree/main/packages/core/src"
click node_config "https://github.com/flint-fyi/flint/tree/main/packages/core/src/configs"
click node_hosts "https://github.com/flint-fyi/flint/tree/main/packages/core/src/host"
click node_cache "https://github.com/flint-fyi/flint/tree/main/packages/core/src/cache"
click node_changes "https://github.com/flint-fyi/flint/tree/main/packages/core/src/changing"
click node_reports "https://github.com/flint-fyi/flint/tree/main/packages/core/src/reporting"
click node_langcore "https://github.com/flint-fyi/flint/tree/main/packages/core/src/languages"
click node_tslang "https://github.com/flint-fyi/flint/tree/main/packages/typescript-language/src"
click node_volarlang "https://github.com/flint-fyi/flint/blob/main/packages/volar-language/src/language.ts"
click node_otherlangs "https://github.com/flint-fyi/flint/blob/main/packages/astro-language/src/language.ts"
click node_tsplugin "https://github.com/flint-fyi/flint/blob/main/packages/ts/src/plugin.ts"
click node_browser "https://github.com/flint-fyi/flint/blob/main/packages/browser/src/plugin.ts"
click node_astro "https://github.com/flint-fyi/flint/blob/main/packages/astro/src/plugin.ts"
click node_jsonrules "https://github.com/flint-fyi/flint/blob/main/packages/package-json/src/plugin.ts"
click node_mdrules "https://github.com/flint-fyi/flint/blob/main/packages/md/src/plugin.ts"
click node_otherrules "https://github.com/flint-fyi/flint/tree/main/packages"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_once,node_watch,node_renderer,node_presenter toneBlue
class node_core,node_config,node_hosts,node_cache,node_changes,node_reports toneAmber
class node_langcore,node_tslang,node_volarlang,node_otherlangs toneMint
class node_tsplugin,node_browser,node_astro,node_jsonrules,node_mdrules,node_otherrules toneRose
class node_user toneIndigo
```

## Components

### CLI workflow

- [CLI entry](https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCli.ts): `packages/cli/src/runCli.ts`
- [Single run](https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCliOnce.ts): `packages/cli/src/runCliOnce.ts`
- [Watch run](https://github.com/flint-fyi/flint/blob/main/packages/cli/src/runCliWatch.ts): `packages/cli/src/runCliWatch.ts`
- [Output renderers](https://github.com/flint-fyi/flint/tree/main/packages/cli/src/renderers): `packages/cli/src/renderers`
- [Report presenters](https://github.com/flint-fyi/flint/tree/main/packages/cli/src/presenters): `packages/cli/src/presenters`

### Linting engine

- [Lint core](https://github.com/flint-fyi/flint/tree/main/packages/core/src): `packages/core/src`
- [Configuration](https://github.com/flint-fyi/flint/tree/main/packages/core/src/configs): `packages/core/src/configs`
- [File hosts](https://github.com/flint-fyi/flint/tree/main/packages/core/src/host): `packages/core/src/host`
- [Lint cache](https://github.com/flint-fyi/flint/tree/main/packages/core/src/cache): `packages/core/src/cache`
- [Fixes and changes](https://github.com/flint-fyi/flint/tree/main/packages/core/src/changing): `packages/core/src/changing`
- [Reports and directives](https://github.com/flint-fyi/flint/tree/main/packages/core/src/reporting): `packages/core/src/reporting`

### Language support

- [Language runtime](https://github.com/flint-fyi/flint/tree/main/packages/core/src/languages): `packages/core/src/languages`
- [TypeScript language](https://github.com/flint-fyi/flint/tree/main/packages/typescript-language/src): `packages/typescript-language/src`
- [Volar languages](https://github.com/flint-fyi/flint/blob/main/packages/volar-language/src/language.ts): `packages/volar-language/src/language.ts`
- [Other languages](https://github.com/flint-fyi/flint/blob/main/packages/astro-language/src/language.ts): `packages/astro-language/src/language.ts`

### Rule plugins

- [TypeScript rules](https://github.com/flint-fyi/flint/blob/main/packages/ts/src/plugin.ts): `packages/ts/src/plugin.ts`
- [Browser rules](https://github.com/flint-fyi/flint/blob/main/packages/browser/src/plugin.ts): `packages/browser/src/plugin.ts`
- [Astro rules](https://github.com/flint-fyi/flint/blob/main/packages/astro/src/plugin.ts): `packages/astro/src/plugin.ts`
- [JSON rules](https://github.com/flint-fyi/flint/blob/main/packages/package-json/src/plugin.ts): `packages/package-json/src/plugin.ts`
- [Markdown rules](https://github.com/flint-fyi/flint/blob/main/packages/md/src/plugin.ts): `packages/md/src/plugin.ts`
- [Additional plugins](https://github.com/flint-fyi/flint/tree/main/packages): `packages`

### Other components

- **Developer**

## Connections

- Developer → CLI entry: invokes (evidence: `packages/cli/src/runCli.ts`)
- CLI entry → Single run: runs once (evidence: `packages/cli/src/runCli.ts`)
- CLI entry → Watch run: starts watch (evidence: `packages/cli/src/runCli.ts`)
- CLI entry → Output renderers: creates renderer (evidence: `packages/cli/src/runCli.ts`)
- Single run → Lint core: runs lint (evidence: `packages/cli/src/runCliOnce.ts`)
- Watch run → Single run: reruns lint (evidence: `packages/cli/src/runCliWatch.ts`)
- Output renderers → Report presenters: selects presenter (evidence: `packages/cli/src/renderers/createRendererFactory.ts`)
- Lint core → Configuration: loads configuration
- Lint core → File hosts: uses file host (evidence: `packages/core/src/types/host.ts`)
- Lint core → Lint cache: caches results
- Lint core → Fixes and changes: applies fixes
- Lint core → Reports and directives: produces reports
- Lint core → Language runtime: runs language visitors
- Language runtime → TypeScript language: uses services
- Language runtime → Volar languages: supports Volar
- Language runtime → Other languages: supports languages
- TypeScript rules → Lint core: creates rules (evidence: `packages/ts/src/plugin.ts`)
- Browser rules → TypeScript language: analyzes syntax
- Astro rules → Other languages: uses Astro language
- JSON rules → Other languages: uses JSON language
- Markdown rules → Other languages: uses Markdown language
- Additional plugins → Lint core: extends core (evidence: `packages/core/src/host/withRepositoryRoot.ts`)
