Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: add command to run prettier on docs #2102

Merged
merged 4 commits into from
Dec 8, 2019
Merged

misc: add command to run prettier on docs #2102

merged 4 commits into from
Dec 8, 2019

Conversation

yangshun
Copy link
Contributor

@yangshun yangshun commented Dec 7, 2019

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
Copy link
Contributor

docusaurus-bot commented Dec 7, 2019

Deploy preview for docusaurus-2 ready!

Built with commit 14e61ce

https://deploy-preview-2102--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Dec 7, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 14e61ce

https://deploy-preview-2102--docusaurus-preview.netlify.com

@@ -17,6 +17,7 @@
"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
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
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
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