$ show platers/obsidian-linter
This is an Obsidian plugin that provides a highly configurable markdown linter and formatter. It implements over 50 individual rules organized by type (YAML, headings, content, spacing, footnotes, paste) using a clean rule-builder pattern with decorators. The plugin integrates deeply with the Obsidian editor, supporting lint-on-save, paste transformations, custom commands, regex replacements, and a comprehensive settings UI with tabs and search. It includes an extensive test suite (unit and integration) and auto-generates documentation from rule definitions. The architecture is modular: each rule is a self-registering class with typed options, examples, and option builders that also drive the settings UI. Shared utilities for YAML manipulation, markdown AST transformations, and ignore-type masking are well-isolated and reusable. The codebase is actively maintained with frequent commits and responsive issue triage.
The LLM identified 4 files worth highlighting for reuse:
Base class for all lint rules. Uses a decorator (@RuleBuilder.register) to auto-register rules into a global dictionary. Provides typed option builders (BooleanOptionBuilder, DropdownOptionBuilder, etc.) that generate both settings UI and documentation. The pattern is self-contained and could be extracted to build any configurable rule system.
Generic utility to temporarily replace sections of text (code blocks, math, YAML, links, tags, etc.) with placeholders, apply a transformation, then restore the original content. This is a reusable pattern for any text manipulation that needs to avoid modifying protected regions. The function is parameterized and has no internal dependencies.
Comprehensive YAML frontmatter manipulation library: extraction, insertion, removal, array formatting (single-line, multi-line, comma/space-delimited), value escaping, and disabled-rules parsing. Uses the 'yaml' npm package but wraps it with Obsidian-specific logic. Could be reused in any markdown tool that needs robust YAML handling.
Markdown AST utilities built on micromark and mdast-util-* packages. Provides functions for moving footnotes, re-indexing, making emphasis/bold consistent, updating list indicators, handling blockquotes, and detecting tables. Uses an LRU cache for parsed ASTs. This is a reusable set of markdown transformation primitives.