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

Idea: playground plugin for running typescript-eslint #2114

Closed
JoshuaKGoldberg opened this issue Oct 28, 2021 · 5 comments
Closed

Idea: playground plugin for running typescript-eslint #2114

JoshuaKGoldberg opened this issue Oct 28, 2021 · 5 comments
Labels
Idea A way we can improve the site

Comments

@JoshuaKGoldberg
Copy link
Contributor

Improvement Idea: Add a plugin that loads ESLint into the playground with typescript-eslint

Why:

To start, there's discussion of building a whole typescript-eslint playground in typescript-eslint/typescript-eslint#168 and typescript-eslint/typescript-eslint#3147. This would both save a ton of infrastructure-y work and let typescript-eslint use "the" standard TypeScript playground.

Additionally, I often use the playground to share examples of "why aren't these types working?" investigations. It'd be really nice to be able to add eslint-plugin-expect-type.

Alternative ideas:

Well, a few folks have built their own (e.g. https://yeonjuan.github.io/typescript-eslint-demo), but that's a lot of work...

@JoshuaKGoldberg JoshuaKGoldberg added the Idea A way we can improve the site label Oct 28, 2021
@orta
Copy link
Contributor

orta commented Oct 28, 2021

Had a play around with @armano2's exceptional work on the that WIP eslint playground (that's exactly the sort of case which I abstracted out the sandbox for) - so anything can be made as a playground plugin, but the biggest question is can you make the setup as ergonomic as https://typescript-eslint-armano.netlify.app/ - which I think is a mixed bag of trade-offs

First time user experience is going to be weaker. You'd have to have a link: like https://www.typescriptlang.org/play/?dtPR=56838&install-plugin=playground-eslint which opens with a "Are you sure you want to install this?" for the first time

Ensuring updates is a bit harder with the plugin because it's not 'update the site and the playground gets the update'. Personally, I'd recommend generating a rollup bundled version of typescript-eslint somewhere to decouple the version of the dep from the playground (which is roughly how the playground works with TS versions) anyway though.

But yeah, that could be done as a plugin then

@armano2
Copy link

armano2 commented May 31, 2022

that's exactly the sort of case which I abstracted out the sandbox for

sandbox is actually really great, its simplifies a lot of things, typescript-eslint playground relies on it heavily https://typescript-eslint.io/play/

are you still planning to add plugin to typescript website for it?

@orta
Copy link
Contributor

orta commented Jun 1, 2022

Me? No,

I especially wouldn't want to compete (as I don't work on the TS website for my job anymore) and probably wouldn't be good at keeping it up to date, me + the TS team ensure that the playground infra keeps running (which ensures new sandbox builds etc) and that's enough.

If you're pretty stable on how URLs work, we could have an 'export to eslint playground' button (like we do for the AST explorer) in the TS playground's export dropdown, which I think would be cool

@JoshuaKGoldberg
Copy link
Contributor Author

have an 'export to eslint playground' button

I love it! Yes please! 🎉

@typescript-bot
Copy link
Collaborator

Hello! As per #2804, we are automatically closing all open issues. Please see #2804 for a description of what issues and PRs can be accepted going forward.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Idea A way we can improve the site
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants