-
-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add condition to check TS parser #744
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 es-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ 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 hi-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 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 de-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
lumirlumir
left a comment
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 another review before merging.
nzakas
left a comment
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. Would like @mdjermanovic to verify before mergin.
| (typeof parser === "object" && | ||
| parser.meta.name === "typescript-eslint/parser") || | ||
| parser === "@typescript-eslint/parser" || | ||
| parser === typeScriptESLintParser |
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.
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?
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.
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.
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.
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.
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.
|
Closing it based on discussion #744 (comment). |

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/parserin playground onlanguageOptions.parser = typeScriptESLintParseroption, this will enable the TS parser when someone directly open the playground fromopen in playgroundbutton in docs.What changes did you make? (Give an overview)
Added a condition to check if
parser === typeScriptESLintParserthen 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