Conversation
|
Have these files been manually verified after prettier's been run? If they haven't, should they be verified? |
|
Verified in what sense? Prettier changes |
README.md
Outdated
| Raymond Feng|Miroslav Bajtos|Ritchie Martori|Kevin Delisle | ||
| :-:|:-:|:-:|:-: | ||
| [<img src="https://avatars0.githubusercontent.com/u/540892?v=3&s=60">](http://github.com/raymondfeng)|[<img src="https://avatars2.githubusercontent.com/u/1140553?v=3&s=60">](http://github.com/bajtos)|[<img src="https://avatars2.githubusercontent.com/u/462228?v=3&s=60">](http://github.com/ritch)|[<img src="https://avatars3.githubusercontent.com/u/2053534?v=3&s=60">](http://github.com/kjdelisle) | ||
| | Raymond Feng | Miroslav Bajtos | Ritchie Martori | Kevin Delisle | |
There was a problem hiding this comment.
The readability is pretty horrendous here. Should we configure prettier so that it doesn't run on tables?
There was a problem hiding this comment.
I'm not sure how to disable it for just tables in md files. Any ideas?
There was a problem hiding this comment.
I don't think it's possible to do it just for tables in prettier. Curious to hear others' opinion on this.
There was a problem hiding this comment.
Great find! I've updated the tables (with the exception of @shimks 's image since I'm not sure how to set the height attribute in reference style and GitHub's s=60 isn't working for his Avatar).
| "files": "**/*.md", | ||
| "options": { | ||
| "parser": "markdown", | ||
| "proseWrap": "always" |
There was a problem hiding this comment.
Should it be preserve? See https://prettier.io/docs/en/options.html#prose-wrap
There was a problem hiding this comment.
preserve didn't enforce lines to be max 80 characters in width (which is what I'm trying to achieve with this PR). Hence went with always.
| - [ ] Related API Documentation was updated | ||
| - [ ] Affected artifact templates in `packages/cli` were updated | ||
| - [ ] Affected example projects in `packages/example-*` were updated | ||
| * [ ] `npm test` passes on your machine |
There was a problem hiding this comment.
Hmm, why * is better than -? Is there a configuration option to override?
There was a problem hiding this comment.
I've looked into this a while ago, and prettier doesn't have configurable list styling, and it doesn't look to be in scope for a while. prettier/prettier#3025
There was a problem hiding this comment.
No config option other than to extend the markdown parser used by prettier and change that there. * and - are treated the same by GFM (GitHub Flavoured Markdown). I think the markdown parser just uses * as it's style.
In VSCode, you can continue using - and saving the file will format it to use * now.
There was a problem hiding this comment.
Forcing to use * is fairly annoying :-(
There was a problem hiding this comment.
Yeah, I also like - more than *. However, I am happy to give up this preference in exchange for automated linting & formatting of Markdown files.
Perhaps we can contribute a feature to prettier to make the preference of * vs. - configurable? They already allow configuration of the quote symbol used in JavaScript files (' or "), I think that should serve as a good precedent?
| *.json | ||
| *.md | ||
| CHANGELOG.md | ||
| .sandbox |
There was a problem hiding this comment.
can we add packages/*/CHANGELOG.md here?
There was a problem hiding this comment.
I think CHANGELOG.md already covers nesting files with the same name.
| [superkhau]: https://avatars1.githubusercontent.com/u/1617364?v=3&s=60 | ||
| [loay]: https://avatars3.githubusercontent.com/u/1986928?v=3&s=60 | ||
| [crandmck]: https://avatars2.githubusercontent.com/u/2925364?v=3&s=60 | ||
| [virkt25]: https://avatars1.githubusercontent.com/u/3311536?v=3&s=60 |
|
+1 for applying Prettier to all markdown files @virkt25 could you please check that the VS Code extension we use to apply Prettier formatting is correctly configured to reformat Markdown files on save? I remember turning automatic reformatting off - see https://github.com/strongloop/loopback-next/blob/20a41ac7081a8cead0011447b5a8e5794a320ded/.vscode/settings.json#L7-L9 |
Ah, that was done for EJS templates, not markdown - see c1d7a52 |
|
Yep, the VSCode extension works great in re-formatting the files. It automatically does word wrapping to 80 characters, adjusts tables based on content, changes |
62360d7 to
f7f713b
Compare
connected to #1099
|
@strongloop/lb-next-dev Do we want to proceed with this PR or should it be abandoned / closed? PROS:
CONS:
|
|
I still feel being forced to use |
|
Closing this as we want prettier to support |
Changes are broken down into 3 commits.
markdownscripts (supports GitHub Flavoured Markdown)Connected to #1099
Checklist
npm testpasses on your machinepackages/cliwere updatedpackages/example-*were updated