Files
skills/plugins/document-navigator/docs/devtools/tooling/linter/README.md
2026-06-09 21:06:27 +01:00

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-runner is the seam between the linter and the Biome CLI. Rather than calling execSync from…
    • biome-runner — @suaveplan/linter/biome-runner is the seam between the linter and the Biome CLI. Rather than calling execSync from…
  • cli — @suaveplan/linter/cli is the pure-function CLI entry point. It parses an argv array, runs the unified orchestrator,…
    • cli — @suaveplan/linter/cli is the pure-function CLI entry point. It parses an argv array, runs the unified orchestrator,…
  • error-codes — @suaveplan/linter/error-codes owns the stable error-code registry and the typed LinterError class that every other…
    • error-codes — @suaveplan/linter/error-codes owns the stable error-code registry and the typed LinterError class that every other…
  • glob-resolver — @suaveplan/linter/glob-resolver expands a list of patterns (glob expressions or file paths) into a sorted, deduplicat…
    • glob-resolver — @suaveplan/linter/glob-resolver expands a list of patterns (glob expressions or file paths) into a sorted, deduplicat…
  • markdown-fixer — @suaveplan/linter/markdown-fixer is the remark-based markdown auto-fixer at the core of the package. It applies a cur…
    • markdown-fixer — @suaveplan/linter/markdown-fixer is the remark-based markdown auto-fixer at the core of the package. It applies a cur…
    • rules — rules.ts houses the individual remark plugins that implement each markdown-lint rule the fixer enforces, plus the sha…
  • telemetry — @suaveplan/linter/telemetry exposes the OpenTelemetry instruments and the record helpers every other module uses to e…
    • telemetry — @suaveplan/linter/telemetry exposes the OpenTelemetry instruments and the record helpers every other module uses to e…
  • unified-lint — @suaveplan/linter/unified-lint is the orchestrator that composes the biome runner and the markdown fixer into a singl…
    • unified-lint — @suaveplan/linter/unified-lint is the orchestrator that composes the biome runner and the markdown fixer into a singl…
  • bin — bin.ts is the executable entry point installed by package.json as the suaveplan-lint binary. 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 — stable LINTER_CODES registry and LinterError class.
  • 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 a LintReport.
  • cli — pure runCli(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.