-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
docs: playground button for TypeScript code example #19671
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
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
@Tanujkanti4441 eslint/eslint.org#714 has been merged 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.
This seems to be working well when an example is opened in the Playground. However, something strange happens when the example is then modified because parser encoded in the url becomes "parser":{"version":"8.28.0","meta":{"name":"typescript-eslint/parser","version":"8.28.0"}
.
To reproduce:
- "Click Open in Playground" in this example: https://deploy-preview-19671--docs-eslint.netlify.app/rules/default-param-last#:~:text=Examples%20of%20incorrect%20TypeScript%20code%20for%20this%20rule
- Add and remove a space anywhere, just to change the URL.
- The URL becomes this: https://eslint.org/play/#eyJ0ZXh0IjoiLyogZXNsaW50IGRlZmF1bHQtcGFyYW0tbGFzdDogW1wiZXJyb3JcIl0gKi9cblxuZnVuY3Rpb24gaChhID0gMCwgYjogbnVtYmVyKSB7fSIsIm9wdGlvbnMiOnsicnVsZXMiOnt9LCJsYW5ndWFnZU9wdGlvbnMiOnsicGFyc2VyIjp7InZlcnNpb24iOiI4LjI4LjAiLCJtZXRhIjp7Im5hbWUiOiJ0eXBlc2NyaXB0LWVzbGludC9wYXJzZXIiLCJ2ZXJzaW9uIjoiOC4yOC4wIn19LCJwYXJzZXJPcHRpb25zIjp7ImVjbWFGZWF0dXJlcyI6eyJqc3giOnRydWV9LCJzb3VyY2VUeXBlIjoibW9kdWxlIn19fX0=
- Copy & paste the URL into another tab.
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 could reproduce this, have sent a fix in eslint/eslint.org#747.
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.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Enabled
open in playground
button for TypeScript code examples.Is there anything you'd like reviewers to focus on?
Can be merged once eslint/eslint.org#714 is finished.