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

Website: [Playground] Add "copy as JSON" option to AST Viewer #6037

Closed
2 tasks done
JoshuaKGoldberg opened this issue Nov 19, 2022 · 3 comments · Fixed by #6728
Closed
2 tasks done

Website: [Playground] Add "copy as JSON" option to AST Viewer #6037

JoshuaKGoldberg opened this issue Nov 19, 2022 · 3 comments · Fixed by #6728
Assignees
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request package: website Issues related to the @typescript-eslint website website: playground

Comments

@JoshuaKGoldberg
Copy link
Member

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

The AST Viewer part of the playground can have a lot of objects in it:

Screenshot of a console.log('Hello, world!') ESTree AST on the playground in the viewer

It'd be nice to add a little Copy as JSON button to the bottom of the AST viewer that copies its contents as a string to the user's clipboard.

Affected URL(s)

https://typescript-eslint.io/play

@JoshuaKGoldberg JoshuaKGoldberg added enhancement New feature or request accepting prs Go ahead, send a pull request that resolves this issue package: website Issues related to the @typescript-eslint website labels Nov 19, 2022
@Josh-Cena
Copy link
Member

Curious what the use case is?

@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Nov 19, 2022

I've personally wanted this a few times when writing docs for ASTs. Also @armano2 had left this as a todo in https://github.com/orgs/typescript-eslint/projects/3. 🤷

@bradzacher
Copy link
Member

I've wanted this a few times tbh - it's a nice thing to have to copy into issues and such as you faff around investigating things or building parser changes. Right now it's a pain because you have to manually expand everything in the AST before copying or else you miss out on bits!

It's definitely a lower priority though as it's not often we need to make AST changes or investigate parser bugs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request package: website Issues related to the @typescript-eslint website website: playground
Projects
None yet
4 participants