This Obsidian plugin formats and styles your notes with a focus on configurability and extensibility. 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 all files, run Lint all files in the vault
.
To lint all files in the current folder run Lint all files in the current folder
. This action includes all subfolders.
You can also lint a folder by right clicking on it in the folder list and selecting "Lint folder" from the options.
When Lint on save
is toggled on, the plugin will lint the current file on manual save (when you press Ctrl+S
).
---
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.
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.
- remove-multiple-spaces
- remove-hyphenated-line-breaks
- remove-consecutive-list-markers
- remove-empty-list-markers
- convert-bullet-list-markers
- proper-ellipsis
- 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
- space-between-chinese-and-english-or-numbers
Pull requests are welcome, especially for new rules.
- Fork this repository
- 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 asignoreCodeBlocksYAMLAndLinks
.
- 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.