b27f84438dce372ad87607310574fa8c20a7c508
* Update `remark-parse` to v7 * fix `link` title and `inlineCode` * fix `code` meta * fix code meta * fix ListItem print * fix heading print result * remove blank line before childList * trim `inlineCode` ast * use List.spread * use ListItem.spread * fix `example-550.md` snap * update `example-522.md` snap * update `example-508.md` snap * update `example-509.md` snap * update `example-222.md` snap * Update listitem print * lower case definition.label to match ast * trim definition.label to match ast * trim definition.label to match ast * unescape Link.title * filter link with no title * fix link title * fix link title * restore preprocess * fix ast massage * Restore list * Update to remark-parse 8.0.2 * Update snapshot tests after rebase * Create legacy `loose` attribute from `spread` Uses @duailibe's suggestion from here: https://github.com/prettier/prettier/issues/6180#issuecomment-499498432 Also backtracks some other unnecessary changes. * Update test case for shortcut reference-style links The commonmark spec does not allow for whitespace between the left and right parts of a full reference-style link. https://spec.commonmark.org/dingus/?text=%5Bfoo%5D%20%5Bbar%5D%0A%0A%5Bbar%5D%3A%20%2Furl%20%22title%22%0A Notice that the `[foo]` is parsed as plain text, while the `[bar]` is parsed as a shortcut reference link. When there is a space between the two, each part is parsed as a separate shortcut style reference link node: https://astexplorer.net/#/gist/d69f5a227e2cbde3f43f0a639bee165c/822b531c252c162faba78e38607db73ef72886d5 Previously they would have been parsed as a single full reference link. Here I update the test-case to account for the shortcut style links. * Add remark-footnotes plugin to replace legacy footnotes option Remark removed the footnotes option in favor of a new remark-footnotes plugin in https://github.com/remarkjs/remark/pull/483 Here I've simply switched to use the plugin instead of the removed option and updated the snapshot tests. * Add test case for #4369 * Do not add gap if has leading space * Restore `inlineCode` ast compare * Restore `isPrevNodeLooseListItem` * Ignore some ast property * Restore blank line, Fix `isPrevNodeLooseListItem` check * Title compare * Ignore `loose` * Fix footnoteDefinition * Fix tabWidth * Style * `footnoteDefinition` is stable now * Fix `_` after link * Revert workaround, url tests * Fix idempotence issue with underscores and autolinks * Fix idempotence issue with underscores and autolinks - attempt # 2 * Fix idempotence issue with underscores and autolinks - attempt # 3 * Fix idempotence issue with underscores and autolinks - part # 4 * More tests * Code style * Only test master passed tests * Update list * Update list * Use code as test name * Fix idempotence issue with underscores and autolinks - part # 5 * Fix idempotence issue with underscores and autolinks - part # 6 * Linting fix * More autolink tests * Fix tests * Rename to `auto-link` * More tests * Disable new cases * tests for issue 4122 * add changelog Co-authored-by: fisker <lionkay@gmail.com> Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
Opinionated Code Formatter
JavaScript
· TypeScript
· Flow
· JSX
· JSON
CSS
· SCSS
· Less
HTML
· Vue
· Angular
GraphQL
· Markdown
· YAML
Your favorite language?
Intro
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
Input
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
Output
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne()
);
Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
Badge
Show the world you're using Prettier →
[](https://github.com/prettier/prettier)
Contributing
See CONTRIBUTING.md.
Languages
JavaScript
98.6%
CSS
0.9%
Vue
0.2%
HTML
0.2%
MDX
0.1%
