-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
test: enforce valid JSON in fenced markdown code blocks #12196
test: enforce valid JSON in fenced markdown code blocks #12196
Conversation
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.
I like this idea, but have some suggestions to improve the end-user experience. 😉
This is great, although for some reason I'd thought that |
I would have expected that too... 😄 I think Prettier doesn't format these JSON fences properly - or doesn't complain about it - because it's not valid JSON. At least, if I'm reading this explanation from a member of the Prettier org correctly: 1
Footnotes |
🎉 This PR is included in version 29.4.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
Enforces valid JSON for fenced code blocks in docs so that static site generators can auto-generate tabbed json/yaml examples.
I tried to also add some helpful annotations for CI, hopefully works as expected but could be tried on a dummy PR without the fixes in f0d2bd5 applied.
Example run before the fix (not sure if too noisy and only errors should be reported):
Context:
This is another tiny step towards #7031, to make things like renovatebot/renovatebot.github.io#65 automatically generate YAML blocks after the feature itself is implemented. As suggested in #7031 (comment).
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: