Skip to content

misc: add command to run prettier on docs - #2102

Merged
yangshun merged 4 commits into
masterfrom
prettier-docs
Dec 8, 2019
Merged

yangshun merged 4 commits into
masterfrom
prettier-docs

Conversation

@yangshun

@yangshun yangshun commented Dec 7, 2019

Copy link
Copy Markdown
Contributor

Motivation

Better formatting for our Markdown files.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Netlify previews.

Related PRs

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 7, 2019
@docusaurus-bot

docusaurus-bot commented Dec 7, 2019 •

Copy link
Copy Markdown
Contributor

@docusaurus-bot

docusaurus-bot commented Dec 7, 2019 •

Copy link
Copy Markdown
Contributor

Comment thread package.json
"postinstall": "yarn tsc",
"prettier": "prettier --config .prettierrc --write \"**/*.{js,ts}\"",
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,ts}\"",
"prettier-docs": "prettier --config .prettierrc --write \"**/*.md\"",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in precommit / ci ?

How about mdx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in precommit/ci?

I was undecided about this. But I guess adding to precommit is ok as long as it doesn't fail the CI because of misformatting.

How about mdx?

I initially tried it but there's an issue prettier/prettier#7041 where Prettier doesn't work with MDX. It's fixed in prettier/prettier#6949 but not released yet. When we upgrade Prettier to the next release we can try including support for prettifying MDX.

@yangshun
yangshun merged commit 55e676c into master Dec 8, 2019
@yangshun
yangshun deleted the prettier-docs branch December 8, 2019 06:04
@endiliey endiliey added pr: maintenance This PR does not produce any behavior differences to end users when upgrading. pr: documentation This PR works on the website or other text documents in the repo. and removed pr: maintenance This PR does not produce any behavior differences to end users when upgrading. pr: documentation This PR works on the website or other text documents in the repo. labels Dec 13, 2019
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* misc: add command to run prettier on docs

* Fix GH issue template

* Fix tests

* Add prettier-docs command to precommit
slorber added a commit that referenced this pull request Oct 15, 2026
…2650)

Add the Prettier to oxfmt migration (#11824), the 2019 Prettier run on
Markdown files (#2102) and a 2018 CRLF to LF line endings fix.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants