I use prettier to format my code. And by default prettier removes/trims trailing whitespaces. This is a good thing but an inconvenience in Markdown files. I use trailing whitespaces in markdown for creating line breaks. I could use <br />
tag but the parser i’m using does not accept that(does not add a line break).
in a .editorconfig
file I could use
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
Do we have a similar setting for prettier, since formatting by an editor is overridden when prettier
comes in last to format the files