@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

TypeScript
71%
Other

highlight.io

Analytics · Developer Tools · Monitoring

9,384

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
76
Repo Health
78
Technical
65
Dependency
Built with
TypeScript 71%
Go 16%
Updated 1 weeks ago
TypeScript
68%
MIT

Hoppscotch

Developer Tools

80,676

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
62
Dependency
Built with
TypeScript 68%
Vue 24%
Updated 1 weeks ago
TypeScript
97%
MIT

HyperDX

Analytics · Developer Tools · Monitoring

9,963

Open source observability platform that unifies logs, traces, metrics, and session replays on ClickHouse — now the core of ClickStack.

View details
89
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
100%
Apache 2.0

ILLA Builder

Design Tools · Developer Tools · Low Code Platforms

12,333

Open-source low-code platform for building internal tools with drag-and-drop UI, reactive data bindings, and real-time collaboration.

View details
55
Repo Health
71
Technical
63
Dependency
Built with
TypeScript 100%
Updated 5 months ago
TypeScript
77%
Other

Joplin

Note Taking

56,853

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
60
Dependency
Built with
TypeScript 77%
JavaScript 14%
Updated 1 weeks ago
TypeScript
52%

Kener

Devops · Monitoring

5,216

Stunning, self-hosted status pages with real-time uptime monitoring, incident management, and multi-channel notifications in a single Docker container.

View details
87
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 52%
Svelte 45%
Updated 1 weeks ago
TypeScript
96%
Other

Langfuse

AI Development · Monitoring

36,276

Open source AI engineering platform for LLM observability, prompt management, evaluation, and debugging — self-host in minutes or use Langfuse Cloud.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
Python
53%
AGPL 3.0

LearnHouse

CMS · Learning Management

2,413

Open-source LMS with AI tutoring, real-time collaboration boards, live code execution, and built-in course monetization — self-hosted in minutes.

View details
90
Repo Health
77
Technical
65
Dependency
Built with
Python 53%
TypeScript 45%
Updated 6 days ago
Python
62%
Apache 2.0

marimo

Data Engineering · Developer Tools

23,309

A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.

View details
90
Repo Health
91
Technical
65
Dependency
Built with
Python 62%
TypeScript 37%
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