5.2 KiB
5.2 KiB
@suaveplan/linter - Unified markdown + biome linting pipeline: remark-based markdown fixer (MD012/022/025/029/031/032/035/036/040/044), injectable CommandRunner-backed biome wrapper, glob resolver, orchestrator with structured LintReport, pure runCli, LINTER_CODES error registry, and OTel self-telemetry.
Unified markdown + biome linting pipeline for Suaveplan: a remark-based
markdown fixer covering MD012/022/025/029/031/032/035/036/040/044, an injectable
CommandRunner-backed biome wrapper, a deterministic glob resolver, an orchestrator
that returns a structured LintReport, a pure runCli, the LINTER_CODES error
registry, and OpenTelemetry self-telemetry. The package is server-tier (Node ≥ 20),
ships zero @suaveplan/* runtime deps other than @suaveplan/error and
@suaveplan/types, and is fully tree-shakeable via per-feature subpath exports.
Documentation tree
- biome-runner —
@suaveplan/linter/biome-runneris the seam between the linter and the Biome CLI. Rather than callingexecSyncfrom…- biome-runner —
@suaveplan/linter/biome-runneris the seam between the linter and the Biome CLI. Rather than callingexecSyncfrom…
- biome-runner —
- cli —
@suaveplan/linter/cliis the pure-function CLI entry point. It parses anargvarray, runs the unified orchestrator,…- cli —
@suaveplan/linter/cliis the pure-function CLI entry point. It parses anargvarray, runs the unified orchestrator,…
- cli —
- error-codes —
@suaveplan/linter/error-codesowns the stable error-code registry and the typedLinterErrorclass that every other…- error-codes —
@suaveplan/linter/error-codesowns the stable error-code registry and the typedLinterErrorclass that every other…
- error-codes —
- glob-resolver —
@suaveplan/linter/glob-resolverexpands a list of patterns (glob expressions or file paths) into a sorted, deduplicat…- glob-resolver —
@suaveplan/linter/glob-resolverexpands a list of patterns (glob expressions or file paths) into a sorted, deduplicat…
- glob-resolver —
- markdown-fixer —
@suaveplan/linter/markdown-fixeris the remark-based markdown auto-fixer at the core of the package. It applies a cur…- markdown-fixer —
@suaveplan/linter/markdown-fixeris the remark-based markdown auto-fixer at the core of the package. It applies a cur… - rules —
rules.tshouses the individual remark plugins that implement each markdown-lint rule the fixer enforces, plus the sha…
- markdown-fixer —
- telemetry —
@suaveplan/linter/telemetryexposes the OpenTelemetry instruments and the record helpers every other module uses to e…- telemetry —
@suaveplan/linter/telemetryexposes the OpenTelemetry instruments and the record helpers every other module uses to e…
- telemetry —
- unified-lint —
@suaveplan/linter/unified-lintis the orchestrator that composes the biome runner and the markdown fixer into a singl…- unified-lint —
@suaveplan/linter/unified-lintis the orchestrator that composes the biome runner and the markdown fixer into a singl…
- unified-lint —
- bin —
bin.tsis the executable entry point installed bypackage.jsonas thesuaveplan-lintbinary. It is intentionally…
Install
bun add @suaveplan/linter
Quick start
import { runUnifiedLint } from "@suaveplan/linter";
const report = await runUnifiedLint({ fix: false });
if (!report.success) {
process.exitCode = 1;
}
Or run the bundled binary:
bunx suaveplan-lint --fix
bunx suaveplan-lint --markdown-only "docs/*.md"
Modules
error-codes— stableLINTER_CODESregistry andLinterErrorclass.telemetry— four OTel instruments and helper functions.markdown-fixer— remark pipeline + processor.markdown-fixer/rules— individual remark rule plugins (re-exported through the markdown-fixer subpath).biome-runner— injectable Biome subprocess wrapper.glob-resolver— pattern expansion with default ignore list.unified-lint— orchestrator returning aLintReport.cli— purerunCli(argv, opts?).
Subpath exports
Every feature is exposed as its own subpath so consumers tree-shake at the feature boundary:
import { fixMarkdown } from "@suaveplan/linter/markdown-fixer";
import { runBiome } from "@suaveplan/linter/biome-runner";
import { LINTER_CODES } from "@suaveplan/linter/error-codes";
The root @suaveplan/linter import re-exports the public surface of every feature.