Skip to content

fix: remove ts expect error#1817

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/remove-ts-expect-error
Aug 1, 2024
Merged

fix: remove ts expect error#1817
graphite-app[bot] merged 1 commit intomainfrom
fix/remove-ts-expect-error

Conversation

@IWANABETHATGUY
Copy link
Member

@IWANABETHATGUY IWANABETHATGUY commented Jul 31, 2024

Description

Closed #1811

@netlify
Copy link

netlify bot commented Jul 31, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 3153a61
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/66ab1befa3cdb900088d9e5e

: never {
if (typeof hook === "function") {
// @ts-ignore
return [hook, {}];
Copy link
Member Author

Choose a reason for hiding this comment

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

previously:
image
current:
image

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly, it still needs ts directive, forgive me poor type gymnastics

@graphite-app
Copy link
Contributor

graphite-app bot commented Jul 31, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “!merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “!merge-as-hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

hook: T,
): T extends ObjectHook<infer A, infer B>
? T extends Function
? [A, {}]
Copy link
Contributor

Choose a reason for hiding this comment

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

I refactor the function to make support ObjectHook<string, {}> for AddonHooks, and remove using infer make typing clear, the @ts-expect-error is not used.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see the pr, but it lost the ability to infer the type

Copy link
Member Author

Choose a reason for hiding this comment

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

And it may cause more type errors in the down stream
image

@IWANABETHATGUY
Copy link
Member Author

I am gonna merge this, but I am open to accept if any one have a better idea

@IWANABETHATGUY IWANABETHATGUY marked this pull request as ready for review August 1, 2024 04:39
@IWANABETHATGUY IWANABETHATGUY force-pushed the fix/remove-ts-expect-error branch from 0fa8543 to 1153c73 Compare August 1, 2024 04:39
@IWANABETHATGUY IWANABETHATGUY self-assigned this Aug 1, 2024
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 1, 2024

Merge activity

  • Aug 1, 1:20 AM EDT: The merge label '!merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 1, 1:22 AM EDT: The merge label '!merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 1, 1:23 AM EDT: IWANABETHATGUY added this pull request to the Graphite merge queue.
  • Aug 1, 1:31 AM EDT: IWANABETHATGUY merged this pull request with the Graphite merge queue.

<!-- Thank you for contributing! -->

### Description
Closed #1811
<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
@IWANABETHATGUY IWANABETHATGUY force-pushed the fix/remove-ts-expect-error branch from 1153c73 to 3153a61 Compare August 1, 2024 05:23
@graphite-app graphite-app bot merged commit 3153a61 into main Aug 1, 2024
@graphite-app graphite-app bot deleted the fix/remove-ts-expect-error branch August 1, 2024 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Reviewing usage of @ts-expect-error, and replace with @ts-ignore if we misused before.

2 participants