Configuration
mediva.config.mjs: what blocks, per-path severity overrides, and plugins.
Don't Panic. The contract says what the guide must contain; the config decides which alarms actually wake the crew.
mdv init config # writes a commented-out mediva.config.mjs, never overwrites
mdv check --config ci.mjs # an explicit config
mdv check --no-config # built-in rules onlyAn unknown key exits 2.
| Key | Does |
|---|---|
rules | final say over what blocks |
overrides | { files, rules } per path; last match wins |
plugins | engine extensions (plugin modules) |
sources, ground, providers, resolver | grounding |
fragments, emptyStates | shared fragments, empty-state markers |
lint | markdownlint's rules for the lint gate |
nothingToCheck | "fail" exits 2 on an empty run |
comment | { marker, grace } for -f pr-comment |
What blocks: rules and overrides
export default {
rules: {
"too-few-words": "off", // turn it off everywhere
"missing-block": "warn", // report it, never fail on it
},
overrides: [
{ files: ["docs/adr/**"], rules: { "missing-section": "off" } },
],
};| Setting | Effect |
|---|---|
code: "off", "warn", "error" | re-levels the finding (heuristic codes cannot be "error") |
rule name: "off" | turns off everything it reports |
| unknown key | config error, with a did-you-mean |
mdv explain <path> lists the settings that apply to a document and every finding config changed.
A document never relaxes its own contract: an <!-- mdv: … --> comment in it is not a directive. For a one-off exception, scope an overrides entry to its path.
Lint findings (markdownlint, unclosed-fence, unclosed-comment, fenced-output, frontmatter-unreadable) are always errors: no rules entry turns them off or down, and naming one in rules is a config error.
Lint gate: markdownlint rules
The lint gate runs first on every document: markdownlint's rules, then mediva's own checks (an unclosed fence, an unclosed <!-- comment, a document fenced whole, front matter that does not read). lint is markdownlint's own configuration object, and the only place lint rules are chosen; no contract, document, flag or plugin selects them.
export default {
lint: { default: false, MD005: true, MD056: true, MD046: { style: "fenced" }, MD040: true }, // the default set, plus fence languages
};lint replaces the default set (MD005 list indent, MD056 table column count, MD046 indented code; mdv explain markdownlint prints it), so list those too if you want to keep them. MD018 (##Heading without a space) is off by default because it also matches prose that opens with #1234; switch it on here if your documents never do. Each rule is true, false or its options: a lint finding is always an error, so a severity ("warning", "error", { severity }) is a config error. mediva's own checks always run and cannot be named here.
Plugins
Config is found up to the git root and is executable code; --no-config skips it. Write one with Authoring plugins, validate with mdv debug plugin <path>.