17 ms·
Pretty much the only benefit I've seen of running prettier on Markdown is to highlight mistakes in formatting that otherwise wouldn't be apparent without viewin
by Shog9 2y ago
Pretty much the only benefit I've seen of running prettier on Markdown is to highlight mistakes in formatting that otherwise wouldn't be apparent without viewing rendered output (which it highlights mostly by trashing the file in some fairly obvious way).
The stated philosophy behind Prettier is to end arguments within a team about how to format code, which... Given Markdown is already heavily constrained, barely applies; unlike other languages supported by Prettier, there are precious few adjustments made to Markdown that are clearly intentionally made in pursuit of consistent readability - indeed, if I recall correctly the Prettier Markdown engine is mostly just a round-trip through the remark.js parser and stringifier, and the results reflect this - the results look mechanical, and it is just as likely to eliminate whitespace that lends clarity as it is to add it (if not, as the GP suggests, more likely).
Sadly, there are remark.js plugins that could have been used to e.g. enforce consistent use of whitespace without stripping everything down to the bare minimum, but last I looked the Prettier folk were pretty hostile toward any suggestions that their (default, bare-minimum-effort) "style" was at all problematic.