Skip to content

Suggestion: Support TypeScript syntax in playground #709

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

Open
1 task
JoshuaKGoldberg opened this issue Mar 17, 2025 · 4 comments · May be fixed by #714
Open
1 task

Suggestion: Support TypeScript syntax in playground #709

JoshuaKGoldberg opened this issue Mar 17, 2025 · 4 comments · May be fixed by #714
Assignees
Labels
accepted enhancement New feature or request

Comments

@JoshuaKGoldberg
Copy link
Contributor

What problem do you want to solve?

Coming over from eslint/eslint#19431 (comment): the playground on http://eslint.org/play right now does not support TypeScript syntax. Now that rules are adding support for TS syntax (eslint/eslint#19173), this blocks their TS-specific blocks from being represented in the playground.

What do you think is the correct solution?

How about:

  • Adding an opt-in option to use @typescript-eslint/parser
  • Having rule samples that use a TypeScript language enable that option

Participation

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

Additional comments

No response

@JoshuaKGoldberg JoshuaKGoldberg added the enhancement New feature or request label Mar 17, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 17, 2025
@nzakas
Copy link
Member

nzakas commented Mar 17, 2025

This seems like a good idea. We'd probably want that option under "Versioning and Config". Would we need any other options for TypeScript parsing?

@JoshuaKGoldberg
Copy link
Contributor Author

TypeScript would need to know:

  • Is it in "jsx" mode or not, for parsing syntax like <div> that might be an assertion or a JSX element
  • Whether the source type is a script or module

Both of those are already in "Versioning and Config".

@nzakas
Copy link
Member

nzakas commented Mar 17, 2025

Awesome, thanks for the clarification.

@nzakas nzakas moved this from Triaging to Ready to Implement in Triage Mar 17, 2025
@Tanujkanti4441
Copy link
Contributor

I'll take this.

@Tanujkanti4441 Tanujkanti4441 self-assigned this Mar 18, 2025
@Tanujkanti4441 Tanujkanti4441 linked a pull request Mar 31, 2025 that will close this issue
1 task
@lumirlumir lumirlumir linked a pull request May 15, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted enhancement New feature or request
Projects
Status: Ready to Implement
Development

Successfully merging a pull request may close this issue.

3 participants