Replies: 9 comments 7 replies
-
I did some investigation on this:
|
Beta Was this translation helpful? Give feedback.
-
We are already using prettier for yaml and json, so that's actually pretty good. Thanks for checking and opening a feature request. |
Beta Was this translation helpful? Give feedback.
-
@abelsiqueira Prettier indeed does Markdown formatting, but not exactly the same as the Markdown lint we have now. Keeping both for md files will lead to conflicts. If I understood you correctly, I can go forward with Prettier to replace our current Markdown lint? |
Beta Was this translation helpful? Give feedback.
-
I think we would need to see where they conflict with each other. Ideally you want the linter and formatter to work together, but that might be hard. Also, one of the advantages of Markdown All in One was the table formatter. Does prettier does something similar? |
Beta Was this translation helpful? Give feedback.
-
I agree we should just migrate to Prettier and drop Markdownlint. Good work, Ni! :) |
Beta Was this translation helpful? Give feedback.
-
I agree! Let's go for Prettier. Thanks @gnawin |
Beta Was this translation helpful? Give feedback.
-
Great! Thanks everyone. I'll convert this to an issue and make sure this is covered also in Readme.dev. |
Beta Was this translation helpful? Give feedback.
-
Hey everyone @abelsiqueira @clizbe @datejada @suvayu @greg-neustroev @gzclarence , after PR #552 we use Prettier for markdown formatting instead of markdown lint. Because Prettier is now also used in pre-commit, it is better that you configure Prettier also locally. To do so, please take a look at the instructions at README.dev.md -> installing software -> 7. Prettier |
Beta Was this translation helpful? Give feedback.
-
Following my feature request of adding a pre-commit hook for Markdown All in One, the developer actually suggested using Prettier instead. yzhang-gh/vscode-markdown#1403 |
Beta Was this translation helpful? Give feedback.
-
Problem
Currently our hook is only markdown lint, that has limitations that I experienced wrt to tables. Markdown All in One is a great plug-in for tables, that will save us from lots of manual formatting. It would be great to add a hook (if available) to pre-commit to make sure everyone uses it to ensure consistency of style.
Investigation
Below is a comparison of the popular plug-ins for markdown formatting. We currently have markdown lint.
Since the starting point of this discussion is to enable table formatting, Prettier and Markdown All in One are both suitable. And we want a pre-commit hook for that, Prettier becomes the best option of the three.
To make it work by "Format on save", Prettier needs to be set as a default formatter (which means markdown lint will not work). However, its formatting conflicts with markdown lint. Two main conflicts are spaces and indentation.
According to the documentation of markdown lint, these are default choices that can also be altered.
Proposal
Supposing that we don't have a strong opinion on these, I propose to
Any opinions? @clizbe @datejada @abelsiqueira
Beta Was this translation helpful? Give feedback.
All reactions