eslint.org icon indicating copy to clipboard operation
eslint.org copied to clipboard

Suggestion: support official plugins like markdown, css, json

Open snitin315 opened this issue 7 months ago • 12 comments

What problem do you want to solve?

Currently, there is no playground for official plugins like markdown, CSS, json, etc. We have #714 which will add typescript-eslint parser support. I think it make sense to support official language plugins as well.

What do you think is the correct solution?

How about:

  • Adding a language/plugin dropdown that would change the editor to lint that perticular language.
  • Initially we had some designs for something similar, but this is a pending todo

https://github.com/eslint/eslint.org/blob/fbd0591a5b8b44441921c332870fae662a9e4daf/src/playground/components/Configuration.js#L624

Participation

  • [x] I am willing to submit a pull request for this change.

Additional comments

No response

snitin315 avatar May 20 '25 13:05 snitin315

I'd like to see some design concepts before committing to it. My main concern is that it will make the UI more complicated.

nzakas avatar May 20 '25 14:05 nzakas

I'm personally in favor of this change. 👍

lumirlumir avatar May 30 '25 11:05 lumirlumir

I'm also in favor. It's been a little inconvenient working around the other plugins without playground support. 😄

+1 to asking for design concepts. Right now the playground is hardcoded to always be JavaScript and single-file. Going multi-file would be a lot more work, so perhaps we can keep to the single-file paradigm and have a "language mode" for that file? The language mode would contain:

  • Parser: default to the current JS one; also allow css, markdown, json
  • Rules: sourcing the list from the plugin corresponding to the parser

How about storing this under Versioning and Config?

Screenshot of the playground Versioning and Config with a Language Mode dropdown added, set to Markdown

Related: #709 for TypeScript parser support. I imagine this could either always on or a sub-option within the JavaScript language mode. Either way I don't think that blocks this issue.

JoshuaKGoldberg avatar Jun 21 '25 16:06 JoshuaKGoldberg

I don't think a dropdown under "language options" is the way to go here. It's buried and doesn't indicate that it will basically change how everything works. I think this language used needs to be prominent and always visible on the page, like we have in the Code Explorer.

nzakas avatar Jun 23 '25 14:06 nzakas

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.

github-actions[bot] avatar Aug 13 '25 22:08 github-actions[bot]

This issue was auto-closed due to inactivity. While we wish we could keep responding to every issue, we unfortunately don't have the bandwidth and need to focus on high-value issues.

github-actions[bot] avatar Aug 21 '25 22:08 github-actions[bot]

Let me come back with a suitable design for this

snitin315 avatar Aug 22 '25 01:08 snitin315

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.

github-actions[bot] avatar Sep 22 '25 22:09 github-actions[bot]

Not stale.

lumirlumir avatar Sep 23 '25 08:09 lumirlumir

I prefer to list all officially supported languages at the top of the editor.

kecrily avatar Sep 23 '25 15:09 kecrily

I agree on having playground for official plugins as well. Agreed on keeping it more visible on the page. How about we do something similar to https://astexplorer.net/?

SwetaTanwar avatar Oct 24 '25 08:10 SwetaTanwar

@SwetaTanwar it would be helpful to see a mockup of what you're describing.

nzakas avatar Oct 27 '25 21:10 nzakas

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.

github-actions[bot] avatar Nov 26 '25 22:11 github-actions[bot]