Format Automatically with Prettier

by Dylan Armstrong
5
4
3
2
1
Score: 52/100

Description

The Obsidian Prettier Plugin automatically formats your Markdown files using Prettier, aligning with the tab and spacing settings defined in the Editor preferences. It supports format-on-save and includes a manual command to format the current file. Unlike other Prettier integrations, it avoids extra configuration and keeps things simple by only respecting tab width and tab usage from the editor. This minimalist approach is ideal for users who want consistent formatting without managing complex rules or settings.

Reviews

No reviews yet.

Stats

6
stars
792
downloads
0
forks
410
days
397
days
397
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
9
commits

Latest Version

a year ago

Changelog

  • Changes how changes are applied from linter to manually adjust editor's codemirror. This fixes the cursor jumping around on save from wrong offsets, and also doesn't uncollapse sections.

README file from

Github

Obsidian Prettier Plugin

This is a formatting plugin for Obsidian.

It uses the built-in settings for tabs and tab spacing so it doesn't require configuration.

Differences from Other Projects

Unlike alexgavrusev/obsidian-format-with-prettier, there's no configuration available. The common prettier settings, tabs and number of spaces are taken from the official settings under Editor.

Installation

Install from community plugins.

Or unzip the latest release into .obsidian/plugins folder of your vault.

Usage

Format on save is enabled by default, and can be changed under plugin settings.

Additionally, a "Format current file" command is available.

Customization

This plugin only provides two options to prettier, namely tabWidth and useTabs. They are taken via the Editor settings. Beyond that, there's no customization provided.

Credits

Significant inspiration taken from alexgavrusev/obsidian-format-with-prettier and platers/obsidian-linter.

License

MIT License, for more details see License

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.