-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Platform Docs: Fix JSX error #59967
Platform Docs: Fix JSX error #59967
Conversation
platform-docs/docs/intro.md
Outdated
/* | ||
The BlockEditorProvider is the wrapper of the block editor's state. | ||
All the UI elements of the block editor need to be rendered within this provider. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing seems wrong or at least not consistent with the rest of the code block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I tried preserving the same spacing in the example as there was before (sans the {}
).
Side note: would be great if we could format the examples using prettier
to avoid this in the future. I think that we can use a standard prettier
config for the platform-docs
that is separate from the Gutenberg config. Just adding a
prettier: {}` in the package.json of the platform-docs should be sufficient.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you made the right change to the formatting though, it seems to be using tabs for me in the GitHub diff while the rest of the example is using spaces. I'm approving the PR anyway, but maybe it's not entirely fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right, I'm not sure why the spaces got converted to tabs.
I've updated it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I tried creating a new PR with improved formatting but it's a bit tricky.
The default in GB repo is tabs. But formatting the markdown docs in platform-docs
using the default results in weird indentation.
I tried configuring prettier only for platform-docs
to use spaces but that conflicts with some GB eslint rules
I tried configuring overrides in https://github.com/WordPress/gutenberg/blob/d30cdd0fab1d1875317896ea4d2ef385eaa957cc/platform-docs/.eslintrc.js to overcome that but it didn't seem to work.
I might give it another shot in the future but I think I won't spend more time on it right now.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
* Update BlockEditorProvider comment * Format the comment * Format using spaces Co-authored-by: michalczaplinski <[email protected]> Co-authored-by: youknowriad <[email protected]>
The example in the "Getting Started" page contained invalid JSX.