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: update to lib types for TS 5.2 RC #7451

Merged
merged 8 commits into from Aug 13, 2023

Conversation

sosukesuzuki
Copy link
Contributor

@sosukesuzuki sosukesuzuki commented Aug 10, 2023

PR Checklist

Overview

Update TypeScript to 5.2.1-rc

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @sosukesuzuki!

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.

@netlify
Copy link

netlify bot commented Aug 10, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 2db6ce1
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64d8810036f2830008c6ddda
😎 Deploy Preview https://deploy-preview-7451--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #7451 (2db6ce1) into main (c225b12) will decrease coverage by 2.10%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7451      +/-   ##
==========================================
- Coverage   87.34%   85.25%   -2.10%     
==========================================
  Files         381      386       +5     
  Lines       13336    13358      +22     
  Branches     3943     3943              
==========================================
- Hits        11648    11388     -260     
- Misses       1308     1593     +285     
+ Partials      380      377       -3     
Flag Coverage Δ
unittest 85.25% <100.00%> (-2.10%) ⬇️

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

Files Changed Coverage Δ
packages/scope-manager/src/lib/decorators.ts 100.00% <ø> (ø)
packages/scope-manager/src/lib/dom.iterable.ts 100.00% <ø> (ø)
packages/scope-manager/src/lib/dom.ts 100.00% <ø> (ø)
packages/scope-manager/src/lib/es5.ts 100.00% <ø> (ø)
...ckages/scope-manager/src/lib/webworker.iterable.ts 100.00% <ø> (ø)
packages/scope-manager/src/lib/webworker.ts 100.00% <ø> (ø)
packages/typescript-estree/src/version-check.ts 100.00% <ø> (ø)
packages/scope-manager/src/lib/es2017.date.ts 100.00% <100.00%> (ø)
packages/scope-manager/src/lib/es2017.ts 100.00% <100.00%> (ø)
...ackages/scope-manager/src/lib/es2023.collection.ts 100.00% <100.00%> (ø)
... and 7 more

... and 7 files with indirect coverage changes

@nx-cloud
Copy link

nx-cloud bot commented Aug 10, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 2db6ce1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 37 targets

Sent with 💌 from NxCloud.

@sosukesuzuki sosukesuzuki marked this pull request as ready for review August 10, 2023 17:17
@@ -20,6 +20,8 @@ const versions = [
'4.8',
'4.9',
'5.0',
'5.1',
'5.2',
Copy link
Member

Choose a reason for hiding this comment

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

...huh. Odd that 5.1 wasn't here before.

"types": ["jest", "node"]
"module": "Node16",
"types": ["jest", "node"],
"moduleResolution": "Node16"
Copy link
Member

Choose a reason for hiding this comment

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

Why this change? Tests still work for me locally after reverting it.

Copy link
Member

Choose a reason for hiding this comment

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

But does it typecheck fine without it?
There's a new error in this version to ensure that things are configured correctly.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I like moving to the newer module & module resolution settings, just curious.

Also, per https://www.typescriptlang.org/tsconfig#moduleResolution, moduleResolution matches module by default with node16 and other newer targets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this change, a type error will occur.

Copy link
Member

Choose a reason for hiding this comment

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

Ah! https://devblogs.microsoft.com/typescript/announcing-typescript-5-2-rc/#module-and-moduleresolution-must-match-under-recent-node-js-settings

       tsconfig.spec.json:5:15 - error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.
       
       5     "module": "CommonJS",
                       ~~~~~~~~~~

Fun! In that case, I think we can get away with just the "module": "Node16":

Suggested change
"moduleResolution": "Node16"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! e829631

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I'll defer to @bradzacher as more knowledgeable on TS upgrades.

Note for any onlookers: we'll still have to add support for using statements separately.

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval PR that a maintainer has LGTM'd - any maintainer can merge this when ready label Aug 12, 2023
bradzacher
bradzacher previously approved these changes Aug 13, 2023
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

Thanks - step one is this! Step two is the new syntax.

Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

next we can get to work on the syntax thanks heaps!

@bradzacher bradzacher changed the title feat: update to TypeScript 5.2 RC feat: update to lib types for TS 5.2 RC Aug 13, 2023
@bradzacher bradzacher merged commit 479f9f6 into typescript-eslint:main Aug 13, 2023
48 of 52 checks passed
@sosukesuzuki sosukesuzuki deleted the update-ts-5.2 branch August 13, 2023 14:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval PR that a maintainer has LGTM'd - any maintainer can merge this when ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants