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

chore(create-vite): set skipLibCheck true #7726

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Apr 14, 2022

Description

Set skipLibCheck: true for all TS templates

Closes #7724
Closes #5814

Additional context


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.

@bluwy bluwy added the p1-chore Doesn't change code behavior (priority) label Apr 14, 2022
@bluwy bluwy requested a review from haoqunjiang April 14, 2022 04:43
@haoqunjiang
Copy link
Member

This PR doesn't fully fix #7662, though.

@bluwy
Copy link
Member Author

bluwy commented Apr 14, 2022

This PR doesn't fully fix #7662, though.

I think the same is for the Vue issue too as it's an error happening in third-party libraries? The issue has an error from tsc but the build should be fine, or maybe that can be fixed too?

@haoqunjiang
Copy link
Member

skipLibCheck never affects Vite build. So enabling it is meant to fix the type errors.
There are still errors in #7662 after this change.
Maybe it's because the @chakra-ui/* types are written in .tsx rather than .d.ts files (skipLibCheck only ignores .d.ts).

I'm not an expert on either Preact or TypeScript, so I can't provide a solution to the problem.

@bluwy
Copy link
Member Author

bluwy commented Apr 14, 2022

Ah I see, for #7662 besides setting skipLibChecks: true, I had also installed @types/react and @types/react-dom locally. That's why I didn't see any errors when testing that. I'll make a note in the issue there, and probably ask around of how to setup preact with typescript. Otherwise we could also add the @types too 🤔

@patak-dev
Copy link
Member

@marvinhagemeister maybe you could help us here?

@ismoiliy98
Copy link

Ah I see, for #7662 besides setting skipLibChecks: true, I had also installed @types/react and @types/react-dom locally. That's why I didn't see any errors when testing that. I'll make a note in the issue there, and probably ask around of how to setup preact with typescript. Otherwise we could also add the @types too 🤔

FYI, if you add @types/react for the preact-ts preset then it will conflict with the JSX typings of the preset (src/preact.d.ts).

@sapphi-red
Copy link
Member

sapphi-red commented Apr 14, 2022

I have found some related issues preactjs/preact#2150, preactjs/preact#2222.
But these solutions are not mentioned in docs. https://preactjs.com/guide/v10/getting-started/#typescript-preactcompat-configuration

@ismoiliy98
Copy link

I have found some related issues preactjs/preact#2150, preactjs/preact#2222. But these solutions are not mentioned in docs. https://preactjs.com/guide/v10/getting-started/#typescript-preactcompat-configuration

Maybe we can apply these solutions in this PR to fix type conflicts?
cc @bluwy @sodatea

@bluwy
Copy link
Member Author

bluwy commented Apr 18, 2022

Maybe we can apply these solutions in this PR to fix type conflicts?

If you're referring to preactjs/preact#2150 (comment), it looks a bit fragile to me and it's been more than a year since the solution is posted. Maybe there's a better way of handling it now.

@bluwy
Copy link
Member Author

bluwy commented Apr 18, 2022

I removed the link to #7662 at the meantime. Perhaps we can deal with the preact template later when there's a solution to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority)
Projects
None yet
5 participants