-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add TypeScript
parser support to playground
#714
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
base: main
Are you sure you want to change the base?
feat: add TypeScript
parser support to playground
#714
Conversation
✅ Deploy Preview for hi-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 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 es-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. |
This is looking good! Can we make the default parser option say "Espree (default)"? @snitin315 this is waiting for your re-review. |
src/playground/App.js
Outdated
...(options?.languageOptions.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.
We need to make sure to pass the languageOptions.sourceType
correctly to parserOptions.sourceType
in case of typeScriptESLintParser, More information here eslint/eslint#19563 (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.
Done!
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 think we can also remove impliedStrict
from ecma features in case of typescriptEslintParser. As per the docs, only jsx
& globalReturn
seems to be valid.

@Tanujkanti4441 It seems there are few merge conflicts now, can you please resolve them? |
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 @nzakas to verify as well.
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.
When @typescript-eslint/parser
is selected, downloaded config file looks like this:
export default [
{
"languageOptions": {
"parser": true
}
}
];
Which is an invalid config file. Perhaps the config file should import the parser and use it?
The value of "parser" serialized in the URL is also |
i didn't get It may be, you mean |
Ping @mdjermanovic |
Sorry for the delay. I was referring to encoded config in the URL. For example: The part after {
"text": "",
"options": {
"rules": {},
"languageOptions": {
"parserOptions": {
"ecmaFeatures": { "jsx": true },
"sourceType": "module"
},
"parser": true
}
}
}
|
@mdjermanovic, i tried to fix this in 229a2e1 can you check this please and tell if it still needs an update? |
I was testing today with the deploy preview (which I believe should represent the latest version), and URLs the Playground generates still have |
Prerequisites checklist
What is the purpose of this pull request?
What changes did you make? (Give an overview)
Added an option called
Parser
under the sectionVersioning and Configuration
to enable@typescript-eslint/parser
in playground.Related Issues
#709
Is there anything you'd like reviewers to focus on?