-
-
Notifications
You must be signed in to change notification settings - Fork 71
fix: playground crash due to ts parser #747
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
Conversation
✅ Deploy Preview for new-eslint ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for es-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for zh-hans-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for fr-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for pt-br-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for ja-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for de-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hi-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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:
eslint.org/src/playground/App.js
Lines 51 to 54 in d531e46
...(options?.languageOptions?.parser === | |
"@typescript-eslint/parser" && { | |
parser: typeScriptESLintParser, | |
}), |
It doesn't reproduce for me with these steps, but does reproduce with the following: 1 - Open Playground and set the parser to 2 - Then refresh the page. 3 - Change something in the text editor, like a space or anything. 4 - Then refresh the page again. |
I think the checks if parser is a typescript-eslint parser object are unnecessary now: eslint.org/src/playground/components/Configuration.js Lines 111 to 121 in 53ce7ec
eslint.org/src/playground/components/Configuration.js Lines 265 to 266 in 53ce7ec
|
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ping @snitin315 |
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 totypeScriptESLintParser
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==
What changes did you make? (Give an overview)
Added a condition in
storeState
function, ifpaser
istypeScriptESLintParser
meta object then make isparser = "@typescript-eslint/parser"
.Related Issues
Is there anything you'd like reviewers to focus on?