Skip to content

Linting

Catch authoring-quality issues with nimbus-docs lint — human output, JSON for agents, and auto-fixes.

AI-generated · awaiting reviewUpdated View as Markdown

A docs site whose content drifts in quality undermines its own product. Nimbus treats authoring quality the way a code linter treats source — a set of rules you run on demand.

Two layers

Pre-build validators run automatically and gate the build only when the issue would break the site — config shape, frontmatter schema, MDX components, duplicate routes.

The lint engine is the on-demand authoring-quality layer. Rules have stable ids like nimbus/single-h1 and nimbus/bare-url. The build is never gated by lint findings — drafts still render, warnings stay loud but unblocking.

Run it

npx @cloudflare/nimbus-docs lint

Flags — combine with lint:

Flag Effect
--format=json agent-readable diagnostics
--rule=nimbus/single-h1 run one rule
--fix apply auto-fixes in place
--quiet errors only

It walks src/content/, runs each authoring rule you’ve enabled, and exits non-zero when any error-severity finding survives.

Configure severities

Severity overrides live with the integration. Map a rule to "error", "warn", or "off":

astro.config.tsts
nimbus(config, {
  rules: {
    "nimbus/single-h1": "error",
    "nimbus/bare-url": "warn",
  },
  collections: {
    partials: { rules: { "nimbus/single-h1": "off" } },
  },
});

Per-collection rules shallow-merge over the top-level set. Authoring rules are off by default — omitting rules entirely runs none of them; you opt in per rule.

In-file disables

Turn rules off for a single file with nimbusDisableRules frontmatter or inline comments — no config required. The severities authored above are materialized to .nimbus/lint.json so the standalone CLI reads the same config the integration does.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close