Skip to content

Conversation

Tanujkanti4441
Copy link
Contributor

@Tanujkanti4441 Tanujkanti4441 commented Jul 26, 2025

Prerequisites checklist

What is the purpose of this pull request?

Right now playground crashes because after a change in text or options the parser key in URL or LocalStorage sets to typeScriptESLintParser meta object rather than "@typescript-eslint/parser" string.

Steps to reproduce.

1 - Open Playground and set the parser to @typescript-eslint/parser.

2 - Change something in the text editor, like a space or anything.

3 - Then refresh the page.

https://eslint.org/play/#eyJ0ZXh0IjoiY29uc3QgZm9vID0gMTA7XG5cblxuIiwib3B0aW9ucyI6eyJydWxlcyI6e30sImxhbmd1YWdlT3B0aW9ucyI6eyJwYXJzZXJPcHRpb25zIjp7ImVjbWFGZWF0dXJlcyI6eyJqc3giOnRydWV9LCJzb3VyY2VUeXBlIjoibW9kdWxlIn0sInBhcnNlciI6eyJ2ZXJzaW9uIjoiOC4yOC4wIiwibWV0YSI6eyJuYW1lIjoidHlwZXNjcmlwdC1lc2xpbnQvcGFyc2VyIiwidmVyc2lvbiI6IjguMjguMCJ9fX19fQ==

Screenshot 2025-07-26 222237

What changes did you make? (Give an overview)

Added a condition in storeState function, if paser is typeScriptESLintParser meta object then make is parser = "@typescript-eslint/parser".

Related Issues

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

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jul 26, 2025
Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for new-eslint ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/new-eslint/deploys/6891b661c4170f00096fbfc2
😎 Deploy Preview https://deploy-preview-747--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.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/es-eslint/deploys/6891b6615b90b70008d5e9f0
😎 Deploy Preview https://deploy-preview-747--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.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/zh-hans-eslint/deploys/6891b661ddc6e30008cc1949
😎 Deploy Preview https://deploy-preview-747--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.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/fr-eslint/deploys/6891b661a6a1450008fd6706
😎 Deploy Preview https://deploy-preview-747--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.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/pt-br-eslint/deploys/6891b6612ee7240008ba772e
😎 Deploy Preview https://deploy-preview-747--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.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/ja-eslint/deploys/6891b66105cdd600082e6a33
😎 Deploy Preview https://deploy-preview-747--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.

Copy link

netlify bot commented Jul 26, 2025

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/de-eslint/deploys/6891b661852125000850c7ce
😎 Deploy Preview https://deploy-preview-747--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

netlify bot commented Jul 26, 2025

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit ccc7e5c
🔍 Latest deploy log https://app.netlify.com/projects/hi-eslint/deploys/6891b66129d4150008f0c05f
😎 Deploy Preview https://deploy-preview-747--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.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

Would it be easier to use typeScriptESLintParser only in optionsForLinter, and "@typescript-eslint/parser" everywhere else? I.e., remove this:

...(options?.languageOptions?.parser ===
"@typescript-eslint/parser" && {
parser: typeScriptESLintParser,
}),

@mdjermanovic mdjermanovic moved this from Needs Triage to Implementing in Triage Jul 27, 2025
@mdjermanovic
Copy link
Member

mdjermanovic commented Jul 27, 2025

Steps to reproduce.

1 - Open Playground and set the parser to @typescript-eslint/parser.

2 - Change something in the text editor, like a space or anything.

3 - Then refresh the page.

It doesn't reproduce for me with these steps, but does reproduce with the following:

1 - Open Playground and set the parser to @typescript-eslint/parser.

2 - Then refresh the page.

3 - Change something in the text editor, like a space or anything.

4 - Then refresh the page again.

@mdjermanovic mdjermanovic added accepted repro:yes Issues with a reproducible example labels Jul 27, 2025
@mdjermanovic
Copy link
Member

I think the checks if parser is a typescript-eslint parser object are unnecessary now:

const parserValue = parser => {
if (
(typeof parser === "object" &&
parser.meta.name === "typescript-eslint/parser") ||
parser === "@typescript-eslint/parser"
) {
return "@typescript-eslint/parser";
}
return null;
};

(typeof parser === "object" &&
parser?.meta?.name === "typescript-eslint/parser")

Copy link
Member

@mdjermanovic mdjermanovic 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 @snitin315 to verify before merging.

@mdjermanovic mdjermanovic moved this from Implementing to Second Review Needed in Triage Aug 5, 2025
Copy link
Member

@harish-sethuraman harish-sethuraman left a comment

Choose a reason for hiding this comment

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

LGTM

@Tanujkanti4441 Tanujkanti4441 moved this from Second Review Needed to Merge Candidates in Triage Aug 6, 2025
@nzakas
Copy link
Member

nzakas commented Aug 6, 2025

Ping @snitin315

@snitin315 snitin315 merged commit 699dbba into eslint:main Aug 7, 2025
37 checks passed
@github-project-automation github-project-automation bot moved this from Merge Candidates to Complete in Triage Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working repro:yes Issues with a reproducible example
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

5 participants