Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Tanujkanti4441
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

https://github.com/eslint/eslint/blob/f46fc6c137c951bc73cf3bd9446053c1b11f769b/docs/.eleventy.js#L215-L217

To set the parser option to @typescript-eslint/parser in playground on languageOptions.parser = typeScriptESLintParser option, this will enable the TS parser when someone directly open the playground from open in playground button in docs.

What changes did you make? (Give an overview)

Added a condition to check if parser === typeScriptESLintParser then set the playground parser to @typescript-eslint/parser.

Related Issues

Is there anything you'd like reviewers to focus on?

Need to add this change before adding playground button for TypeScript code example eslint/eslint#19671

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/es-eslint/deploys/687ce7449f1c440008065c04
😎 Deploy Preview https://deploy-preview-744--es-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for new-eslint ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/new-eslint/deploys/687ce744bc6de200081eb7a4
😎 Deploy Preview https://deploy-preview-744--new-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/hi-eslint/deploys/687ce744cb02650008975df6
😎 Deploy Preview https://deploy-preview-744--hi-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/ja-eslint/deploys/687ce7443872b400080f10c5
😎 Deploy Preview https://deploy-preview-744--ja-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/zh-hans-eslint/deploys/687ce74497870900086de0fe
😎 Deploy Preview https://deploy-preview-744--zh-hans-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/fr-eslint/deploys/687ce744073e590008924929
😎 Deploy Preview https://deploy-preview-744--fr-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/pt-br-eslint/deploys/687ce744c92b0e000848aa0f
😎 Deploy Preview https://deploy-preview-744--pt-br-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 590b119
🔍 Latest deploy log https://app.netlify.com/projects/de-eslint/deploys/687ce744d2eb8e0008a6b25d
😎 Deploy Preview https://deploy-preview-744--de-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@lumirlumir lumirlumir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Would like another review before merging.

@lumirlumir lumirlumir moved this from Needs Triage to Second Review Needed in Triage Jul 21, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would like @mdjermanovic to verify before mergin.

(typeof parser === "object" &&
parser.meta.name === "typescript-eslint/parser") ||
parser === "@typescript-eslint/parser" ||
parser === typeScriptESLintParser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this change. Shouldn't the Open in Playground button send "parser":"@typescript-eslint/parser" in options.languageOptions, not the parser object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried "parser":"@typescript-eslint/parser" but got this error, and it is not working as expected:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share a branch with a code change that is causing this error?

Note that we want to pass "parser":"@typescript-eslint/parser" to the playground, not to the code that underlines errors in code example on the docs site.

https://github.com/eslint/eslint/blob/f46fc6c137c951bc73cf3bd9446053c1b11f769b/docs/.eleventy.js#L231-L236

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you are right, "parser":"@typescript-eslint/parser" is working and have implemented in eslint/eslint#19671.

So I think this PR can be closed, thanks.

@Tanujkanti4441
Copy link
Contributor Author

Closing it based on discussion #744 (comment).

@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

4 participants