We should use prettier to format the markdown documentation for consistency. (See https://github.com/stylelint/stylelint/pull/4435). At the moment I'm using "Save without formatting" whenever I work on markdown files in stylelint.
However, this will require us to add /* prettier-ignore */ comments inside our CSS examples which show idiosyncratic patterns. This should only be for the whitespace rules.
We'll also probably need to strip out these comments as part of the website transformation script.
Any objections to this proposal?
No, :+1: for prettier
I'll label this ready to implement as there are only thumbs up.
However, this will require us to add
/* prettier-ignore */comments inside our CSS examples which show idiosyncratic patterns.
I did a little more digging, and we should use <!-- prettier-ignore --> comments above our CSS examples, rather than /* prettier-ignore */ within them as the latter will show up in our docs. Fortunately, the prettier command comments exclude the next node in the abstract syntax tree from formatting so implementing this should be a find and replace on CSS opening code fences, rather than anything more time-consuming.
I'll implement after we merge https://github.com/stylelint/stylelint/pull/4548.
To clarify, we need to add ignore comments before every ```css, ```scss, and ```less blocks. And will have to always remember to add these comments (and tell our contributors) before every rule in future. (Or write a remark plugin to check this).
Most helpful comment
No, :+1: for prettier