Skip to content
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

feat: Support 'latest' as ecmaVersion #3873

Merged

Conversation

wafuwafu13
Copy link
Contributor

@wafuwafu13 wafuwafu13 commented Sep 12, 2021

Done: #3857

@typescript-eslint
Copy link
Contributor

@typescript-eslint typescript-eslint bot commented Sep 12, 2021

Thanks for the PR, @wafuwafu13!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@@ -26,7 +30,7 @@ interface ParserOptions {
globalReturn?: boolean;
jsx?: boolean;
};
ecmaVersion?: EcmaVersion;
ecmaVersion?: EcmaVersion | 'latest';
Copy link
Contributor Author

@wafuwafu13 wafuwafu13 Sep 12, 2021

Choose a reason for hiding this comment

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

Ref: #3710 (comment)

let's remove latest from here and add it to the parser types as we're now handling it specifically within the parser

| 2020;
| 2020
| 2021
| 2022;
Copy link
Contributor Author

@wafuwafu13 wafuwafu13 Sep 12, 2021

Choose a reason for hiding this comment

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

Ref: #3710 (comment)

Added 2021 and 2022

* Convert ecmaVersion to lib.
* `'latest'` is converted to 1e8 at parser.
*/
function mapEcmaVersion(version: EcmaVersion | 1e8 | undefined): Lib {
Copy link
Contributor Author

@wafuwafu13 wafuwafu13 Sep 12, 2021

Choose a reason for hiding this comment

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

Ref: #3710 (comment)

you don't need/want this check any more

@codecov
Copy link

@codecov codecov bot commented Sep 12, 2021

Codecov Report

Merging #3873 (f6bf7c6) into master (4a88de2) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3873      +/-   ##
==========================================
- Coverage   92.70%   92.62%   -0.09%     
==========================================
  Files         329      310      -19     
  Lines       11534    10118    -1416     
  Branches     3257     2883     -374     
==========================================
- Hits        10693     9372    -1321     
+ Misses        368      312      -56     
+ Partials      473      434      -39     
Flag Coverage Δ
unittest 92.62% <ø> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/scope-manager/src/analyze.ts 66.66% <ø> (ø)
...estree/src/create-program/createIsolatedProgram.ts
...ript-estree/src/create-program/createSourceFile.ts
packages/typescript-estree/src/simple-traverse.ts
packages/typescript-estree/src/node-utils.ts
...pt-estree/src/ts-estree/estree-to-ts-node-types.ts
...pt-estree/src/create-program/createWatchProgram.ts
...ckages/typescript-estree/src/jsx/xhtml-entities.ts
packages/typescript-estree/src/convert.ts
packages/typescript-estree/src/ts-estree/index.ts
... and 10 more

Copy link
Member

@bradzacher bradzacher left a comment

thanks!

@bradzacher bradzacher merged commit 25a42c0 into typescript-eslint:master Sep 21, 2021
11 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants