@codemirror/lint

Linting support for the CodeMirror 6 code editor, with diagnostics, an error gutter, tooltips, and a lint panel.

Library
npm
v6.9.7
26 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
24 /100 Needs Attention
Development Activity 4
Maintenance 0
Community 20
Maturity 60
Momentum 12

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
84 /100 Excellent
Architecture 85
Code Quality 78
Innovation 88
Learning Curve 70

@codemirror/lint is the official linting extension for the CodeMirror 6 code editor. It provides the machinery to attach one or more linters to an editor, collect the diagnostics they produce, and surface those problems to the user through underlines in the document, a color-coded gutter, hover tooltips, and a navigable lint panel.

Linters are plain functions that receive the editor view and return an array of diagnostics (synchronously or via a promise), each carrying a position range, severity, message, and optional quick-fix actions. The package debounces linting on document changes, renders the results, and ships a keymap and commands for opening the panel and jumping between problems, so integrators can wire up rich diagnostic feedback with only a few lines of configuration.

What You Get

  • A linter() extension that runs your lint source (sync or async) with configurable debounce delay and refresh control.
  • Document decorations, a color-coded lint gutter, and hover tooltips that render each diagnostic in place.
  • A lint panel plus a keymap and commands (openLintPanel, nextDiagnostic, previousDiagnostic) for reviewing and navigating problems.
  • A typed Diagnostic model with severities, sources, quick-fix Actions, and helpers like setDiagnostics, diagnosticCount, and forEachDiagnostic.

Common Use Cases

  • Showing syntax or semantic errors from a language parser inline in a CodeMirror-based editor.
  • Surfacing results from an external linter (ESLint, a JSON schema validator, a custom rule engine) as underlines and gutter markers.
  • Offering one-click quick-fix actions attached to individual diagnostics.
  • Building an in-editor problems panel that users can page through with the keyboard.

Under The Hood

Architecture

The entire package lives in a single ~1,015-line src/lint.ts module built on the CodeMirror 6 extension primitives. Diagnostics are held in a StateField updated through a setDiagnosticsEffect StateEffect, so lint results become part of editor state and are automatically mapped across document changes. A ViewPlugin (LintPlugin) debounces re-linting on updates and dispatches the effect when a lint source resolves; the state field derives a RangeSet of mark decorations, feeds hover tooltips via hoverTooltip, and drives an optional gutter (lintGutter) built from GutterMarkers. The lint panel is a showPanel construction that lists diagnostics and supports keyboard navigation through nextDiagnostic/previousDiagnostic commands.

Tech Stack

Written entirely in TypeScript (100% of the source) and published as dual ESM/CJS output with type declarations via the cm-buildhelper tool. Runtime dependencies are minimal and peer-aligned with the editor: @codemirror/state, @codemirror/view, and crelt (a tiny DOM element-creation helper). It targets CodeMirror 6 and carries no framework coupling beyond the editor core.

Code Quality

The public API is defined through documented TypeScript interfaces (Diagnostic, Action, LintSource) with /// doc comments that feed the generated reference docs. A test/test-lint.ts suite exercises the core behavior (diagnostic mapping, counting, panel navigation) with seven cases run through CodeMirror’s cm-runtests harness. The code is dense but consistently structured, favoring small exported functions and clear separation between state, view, and panel concerns.

API Design The surface is deliberately small and composable: a single linter() factory returns an extension you drop into your editor config, diagnostics are plain data objects, and everything else (gutter, keymap, panel) is opt-in. Naming is consistent with the wider CodeMirror ecosystem, and the reference documentation on codemirror.net covers every export. Getting a basic linter running takes only a lint function and the linter() call, while advanced needs (filters, custom rendering, quick-fix actions, auto-opening panels) are handled through well-typed configuration options.

Used by 38 apps in this directory

Clojure
57%
Other

Metabase

Analytics

49,827

The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.

View details
95
Repo Health
84
Technical
62
Dependency
Built with
Clojure 57%
TypeScript 38%
Updated 6 days ago
TypeScript
88%
MIT

Mistle

AI Agents · Developer Tools

95

Self-hostable platform for running autonomous coding agents in isolated, credentialless sandboxes with brokered credentials, reusable snapshots, and event-driven triggers.

View details
50
Repo Health
76
Technical
70
Dependency
Built with
TypeScript 88%
Rust 11%
Updated 4 weeks ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

208,437

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
62
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
99%
Other

NocoBase

Low Code Platforms · No Code Platforms

24,686

Open-source AI + no-code platform that lets coding agents and people collaborate to build business systems fast on proven infrastructure.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago
Go
63%
MIT

Obot

AI Agents · Mcp

1,120

An open-source MCP platform for organizations — host MCP servers, run MCP registries, monitor usage, and build agents and chatbots on top of the Model Context Protocol from one self-hosted deployment.

View details
88
Repo Health
70
Technical
70
Dependency
Built with
Go 63%
Svelte 21%
TypeScript 15%
Updated 1 weeks ago
TypeScript
97%
GPL 3.0

OpenKnowledge

Code Editors · Knowledge Management · Note Taking

4,674

A beautiful, local-first markdown IDE that turns any git repo into a live collaborative workspace for humans and AI coding agents like Claude, Codex, and OpenCode.

View details
80
Repo Health
89
Technical
64
Dependency
Built with
TypeScript 97%
Updated 6 days ago
Python
73%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

40,705

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 73%
TypeScript 12%
Rust 11%
Updated 6 days ago
JavaScript
64%
AGPL 3.0

overleaf

Collaboration · Productivity

18,266

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
84
Repo Health
80
Technical
59
Dependency
Built with
JavaScript 64%
TypeScript 30%
Updated 1 months ago
Python
49%
Other

Arize Phoenix

Analytics · Devops · Monitoring

11,976

Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.

View details
92
Repo Health
88
Technical
67
Dependency
Built with
Python 49%
TypeScript 43%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers