feat(markdown): respect tabWidth for list items#3990
Conversation
|
Thank you for this PR @ikatyang! I pasted a part of the document I had problems with into your playground and the output was much better! No three spaces any more! This means that the preview won't be broken on GitHub/GitHub and that my text editor won't go crazy when I One last thing I'm not sure how to configure is using |
See https://prettier.io/docs/en/configuration.html#configuration-overrides, or if you're talking about js/ts code block in markdown, it's currently not supported. |
|
That's exactly what I needed, thanks! ❤️ |
|
Really looking forward to go for this module.exports = {
// tabWidth: 2, // default
overrides: [
{
files: "*.md",
options: {
tabWidth: 4,
},
},
],
};As mentioned in #3459 (comment), a huge bonus of having |
|
@ikatyang who would be the best people to review this? Shall we ping them? |
|
cc @azz |
azz
left a comment
There was a problem hiding this comment.
LGTM. Sorry for the delay in reviewing.
|
Perfect, thank you all! Are you planning to fit this change into the upcoming 1.11? That would be just awesome, I can't wait 🙌 😃 |
|
Yes it will be in 1.11. |
|
@azz could you add this to my changelog PR? |
|
Just upgraded to 1.11 and all worked! Thank you so much @ikatyang for responding to my concerns in #3459 (comment) so quickly and to the rest of the team for such a great work on the new release! To be honest, when I saw three spaces in my markdown after prettier went through it, I thought I'd need to enter a long and hard debate because 2/4 spaces would be a breaking change. However, the ease and the speed with which the change went through ended up beyond my even most optimistic expectations! You all rock! 🗿 😄 |
Context: #3459 (comment)
This PR improves the indenting experience in VSCode (probably other editors as well) and also fixes #3459, I'm not sure if this is the proper fix but at least we can see the result and decide if it should be closed/merged.
tabWidthtabWidth: 2, otherwise all lists.cc @kachkaev
Prettier pr-3990
Playground link
Input:
Output: