How quick-lint/quick-lint-js works
Main Components
The system architecture should be divided into these core components:
a) Core Engine Components:
• Lexer (src/quick-lint-js/fe/lex.*)
• Parser (src/quick-lint-js/fe/parse.*)
• Variable Analyzer (src/quick-lint-js/fe/variable-analyzer.*)
• Diagnostic System (src/quick-lint-js/diag/*)
b) Interface Components:
• CLI Interface (src/quick-lint-js/cli/*)
• LSP Server (src/quick-lint-js/lsp/*)
• Editor Plugins
• VSCode
• Vim/Neovim
• Emacs
• Sublime Text
• Kate
c) Supporting Systems:
• Configuration System (src/quick-lint-js/configuration/*)
• I/O Management (src/quick-lint-js/io/*)
• Internationalization (src/quick-lint-js/i18n/*)
• Logging/Tracing (src/quick-lint-js/logging/*)
┌─────────────────── Editor Integrations ───────────────────┐
• VSCode │ Vim │ Emacs │ Sublime │ Kate │ CLI │
• Interface Layer ──────────────────────┤
• LSP Server │ Direct API Access │
• Core Engine Layer ────────────────────┤
• Lexer → Parser → Variable Analyzer → Diagnostics │
• Support Systems ─────────────────────┤
• Config │ I/O Manager │ i18n │ Logging │ Error Reporting │
• ┘
Component Interactions
a) Input Flow:
• JavaScript source code enters through editor plugins or CLI
• Code flows through LSP server or direct API
• Lexer processes input into tokens
• Parser creates AST
• Variable analyzer checks for semantic errors
• Diagnostics system generates error reports
b) Configuration Flow:
• Configuration system reads settings
• Settings influence all components' behavior
• I/O manager handles file operations
Additional Details
Annotations for:
• File formats supported
• Communication protocols
• Performance-critical paths
• Error handling flows
• Configuration options