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: avoid type mismatch with Rollup (fix #7843) #8701

Merged
merged 2 commits into from
Jun 24, 2022
Merged

fix: avoid type mismatch with Rollup (fix #7843) #8701

merged 2 commits into from
Jun 24, 2022

Conversation

kachick
Copy link
Contributor

@kachick kachick commented Jun 21, 2022

Description

TS2430 appears when using skipLibCheck: false

I have some React projects. Sometimes I would like to configure skipLibCheck: false, however it makes errors only here.

fixes #7843

Additional context

Initially tried to merge original types more, but I've given up 🙇‍♂️

I don't have confident for below points.

  • Wihch option should be preferred between strictNullChecks: true and strict: true in the tsconfig.check.json?
  • Wihch prefix should be preferred between fix: and types: in the commit message?

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

TS2430 appears when using `skipLibCheck: false`
@sapphi-red
Copy link
Member

It seems changing method (foo?(): void) to property (foo?: () => void) works.

@netlify
Copy link

netlify bot commented Jun 23, 2022

Deploy Preview for vite-docs-main ready!

Name Link
🔨 Latest commit 6c4fe1f
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b4712836247600091f286a
😎 Deploy Preview https://deploy-preview-8701--vite-docs-main.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 settings.

@kachick
Copy link
Contributor Author

kachick commented Jun 23, 2022

Wow thank you for letting me know!
Replacing it and adding isEntry passed the typecheck 🙏

However CI on macos looks failing 👀

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@patak-dev patak-dev merged commit 87e51f7 into vitejs:main Jun 24, 2022
@kachick
Copy link
Contributor Author

kachick commented Jun 24, 2022

Thank you for review and merging 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants