feat: add TypeScript parser support to playground#714
feat: add TypeScript parser support to playground#714snitin315 merged 15 commits intoeslint:mainfrom
TypeScript parser support to playground#714Conversation
✅ 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.
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)
snitin315
left a comment
There was a problem hiding this comment.
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? |
mdjermanovic
left a comment
There was a problem hiding this comment.
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 |
|
Ping @eslint/eslint-team |
lumirlumir
left a comment
There was a problem hiding this comment.
LGTM, Thanks!
Would like @mdjermanovic and @snitin315 to verify the changes before merging.
Prerequisites checklist
What is the purpose of this pull request?
What changes did you make? (Give an overview)
Added an option called
Parserunder the sectionVersioning and Configurationto enable@typescript-eslint/parserin playground.Related Issues
#709
Is there anything you'd like reviewers to focus on?