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

fix(type-utils): treat intrinsic types as if they are from lib and never match error types #6869

Merged
merged 4 commits into from Jul 7, 2023

Conversation

RebeccaStevens
Copy link
Contributor

@RebeccaStevens RebeccaStevens commented Apr 8, 2023

PR Checklist

Overview

Adds explicit logic for intrinsic types and error types.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @RebeccaStevens!

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 Apr 8, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit e04ca7b
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64a78d16ccbf7b0008ee8313
😎 Deploy Preview https://deploy-preview-6869--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.

@RebeccaStevens
Copy link
Contributor Author

@marekdedic

@nx-cloud
Copy link

nx-cloud bot commented Apr 8, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit e04ca7b. 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 31 targets

Sent with 💌 from NxCloud.

@marekdedic
Copy link
Contributor

Hmm, good catch that native types aren't covered... Treating them as being from a lib is a bit of a simplification, but I think it's OK.

Not a maintainer, but could you please add a test?

@codecov
Copy link

codecov bot commented Apr 8, 2023

Codecov Report

Merging #6869 (86372df) into v6 (e6235bf) will decrease coverage by 0.25%.
The diff coverage is 60.00%.

❗ Current head 86372df differs from pull request most recent head 0990cf6. Consider uploading reports for the commit 0990cf6 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##               v6    #6869      +/-   ##
==========================================
- Coverage   87.70%   87.46%   -0.25%     
==========================================
  Files         372      374       +2     
  Lines       12813    12887      +74     
  Branches     3795     3812      +17     
==========================================
+ Hits        11238    11271      +33     
- Misses       1199     1231      +32     
- Partials      376      385       +9     
Flag Coverage Δ
unittest 87.46% <60.00%> (-0.25%) ⬇️

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

Impacted Files Coverage Δ
packages/type-utils/src/TypeOrValueSpecifier.ts 83.87% <60.00%> (-6.46%) ⬇️

... and 40 files with indirect coverage changes

@RebeccaStevens RebeccaStevens changed the title fix(type-utils): treat native types as if they are from lib fix(type-utils): treat intrinsic types as if they are from lib Apr 8, 2023
@bradzacher bradzacher added the bug Something isn't working label Apr 10, 2023
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.

Yup seems reasonable so far, but I'll take a closer look once there's some test coverage. 👍

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Apr 16, 2023
@RebeccaStevens RebeccaStevens force-pushed the issue/6867 branch 2 times, most recently from 6815b8c to cae8223 Compare June 15, 2023 11:17
@RebeccaStevens RebeccaStevens changed the title fix(type-utils): treat intrinsic types as if they are from lib fix(type-utils): treat intrinsic types as if they are from lib and never match error types Jun 15, 2023
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.

Great, thanks @RebeccaStevens! 🚀

@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0 milestone Jun 17, 2023
Copy link
Contributor

@marekdedic marekdedic left a comment

Choose a reason for hiding this comment

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

I'd like to see one more test for error types, otherwise LGTM, thanks!

packages/type-utils/src/TypeOrValueSpecifier.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg
Copy link
Member

@RebeccaStevens is this still something you have time to look into soon? No worries if not, I can touch things up myself tomorrow / this weekend in preparation for v6 (currently scheduled for Monday!).

@RebeccaStevens
Copy link
Contributor Author

I just rebase this PR off the latest v6 branch and updated ts-api-utils.
I think everything should be ready to go now.

Let me know if there is anything else that needs doing.

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.

💯 woop!

@JoshuaKGoldberg JoshuaKGoldberg merged commit ecb57de into typescript-eslint:v6 Jul 7, 2023
42 of 44 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants