Closed nuke-web3 closed 1 year ago
https://dprint.dev/plugins/markdown/config/#ignoreDirective
Actually if I can get this to work, that is all I need. The playground is working for this:
## Something
Working format
<!-- prettier-ignore -->
Ignore format
With config snippet:
{
"ignoreNodeCommentText": "prettier-ignore",
}
So in collaborating with others that use prettier instead of dprint (for example via prettier setup to automatically run on an IDE), here is an example of problem:
<diagram class="mermaid limit size-40">
<!-- prettier-ignore-start -->
flowchart TD
subgraph paraA[Parachain A .]
executor --"success?"--> palletxcm
palletxcm("pallet-xcm") --"execute"--> executor("xcm-executor")
end
execute("execute(xcm)") --> palletxcm
<!-- prettier-ignore-end -->
</diagram>
Prettier needs there to be no new lines to respect the inner block. But dprint formats to
<diagram class="mermaid limit size-40">
<!-- prettier-ignore-start -->
flowchart TD
subgraph paraA[Parachain A .]
executor --"success?"--> palletxcm
palletxcm("pallet-xcm") --"execute"--> executor("xcm-executor")
end
execute("execute(xcm)") --> palletxcm
<!-- prettier-ignore-end -->
</diagram>
And a run of prettier after this formats the block in an untended way.
To make use of this tool easy to transition or be directly compatible with Prettier users, I would love to have https://dprint.dev/plugins/markdown/#ignore-comments be expanded to also ignore using:
<!-- prettier-ignore -->
<!-- prettier-ignore-start --> ... <!-- prettier-ignore-end -->