markdownlint-obsidian
v1.1.0
Published
Obsidian Flavored Markdown linting engine — programmatic API and rule set
Maintainers
Readme
markdownlint-obsidian
Obsidian Flavored Markdown linting engine — programmatic API and rule set.
No CLI dependencies. Use this when you want to drive linting from your own
Node.js or Bun application without pulling in commander.
Install
npm install markdownlint-obsidian
bun add markdownlint-obsidianConsumers can run the library under Node.js 20+ or Bun 1.1+.
Programmatic API
import { lint, fix, getFormatter } from "markdownlint-obsidian/engine";
// Lint files
const results = await lint({
globs: ["**/*.md"],
cwd: process.cwd(),
});
// Fix in place
const outcome = await fix({
globs: ["**/*.md"],
cwd: process.cwd(),
});
// Check mode (no writes)
const checkOutcome = await fix({
globs: ["**/*.md"],
cwd: process.cwd(),
check: true,
});
// Format results
const formatter = getFormatter("sarif");
const sarif = formatter(results);Configuration and formatters
loadConfig(cwd)loads.obsidian-linter.jsoncfrom the working tree and applies defaults.getFormatter(name)returns one of the built-in output adapters:default,json,junit, orsarif.- The public rule-authoring surface lives under
markdownlint-obsidian/api; the built-in rule catalog lives undermarkdownlint-obsidian/rules.
Exports
| Sub-path | Contents |
| --- | --- |
| markdownlint-obsidian | Public API (same as /api) |
| markdownlint-obsidian/api | LinterConfig, LintResult, helpers |
| markdownlint-obsidian/rules | Built-in rule definitions |
| markdownlint-obsidian/engine | lint(), fix(), getFormatter(), loadConfig() |
Developing in this monorepo
bun install
cd packages/core
bun test
bun run buildSee src/README.md for the layer map and
examples/README.md for custom-rule examples.
License
MIT
