This Obsidian plugin applies consistent styling to your markdown files. Rules can be toggled and configured in the settings.
To lint the current file, run Lint the current file
(Ctrl+Alt+L
by default).
To lint the all files, run Lint all files in the vault
.
When Lint on save
is toggled on, the plugin will lint the current file on save.
---
disabled rules: [ capitalize-headings ]
---
Add disabled rules: [ ... ]
to the YAML frontmatter of a file to disable those rules when linting that file.
Add disabled rules: [ all ]
to the YAML frontmatter of a file to disable all rules.
Pull requests are welcome, especially for new rules.
- Clone the repository
- Run
npm ci
to install dependencies - Add a new rule in
rules.ts
.- Insert a new rule in the corresponding rule type(spacing, headings, etc)
- Follow the format of the existing rules
- Add tests for edge cases in
test.ts
- You should probably use some helper functions from
utils.ts
, such asignoreCodeBlocksAndYAML
.
- Run
npm run compile
to build, generate documentation, and test the plugin. - Run
npm run lint
to lint the plugin.
Make sure to use Node 15.x or higher.
Documentation for all rules can be found in the rules docs. The docs are updated before the plugin is released, so may not be completely accurate.
- format-tags-in-yaml
- yaml-timestamp
- header-increment
- file-name-heading
- capitalize-headings
- move-footnotes-to-the-bottom
- re-index-footnotes
- footnote-after-punctuation
- trailing-spaces
- heading-blank-lines
- paragraph-blank-lines
- space-after-list-markers
- compact-yaml
- consecutive-blank-lines
- convert-spaces-to-tabs
- line-break-at-document-end