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.
The spacing seems wrong or at least not consistent with the rest of the code block.
There was a problem hiding this comment.
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.
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.
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.
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 <czapla@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
The example in the "Getting Started" page contained invalid JSX.