-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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(create-docusaurus): Fix TS issues on newly initialized sites #10694
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Josh-Cena any opinion on this removal?
I thought
types
added packages for TS to look at, but it turns out it's the opposite and it restricts TS to only look at these types.https://www.typescriptlang.org/tsconfig/#types
I misunderstood this config initially and not sure why we would use this instead of just having explicit dependencies. 🤔
More historical context about our TS preset is available here:
Wondering if this is safe to be considered as a bugfix for v3, or if I should change this later for v4.
The alternative is that our init template has to depend on
@docusaurus/theme-classic
+@types/node
just because of pnpm (maybe yarn berry pnp too but tsc is disabled in CI atm):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to ship this in next patch and consider it a bugfix
Although it's not 100% retro-compatible, I think it's fine to consider that a site that use types without explicitly depending on them is a buggy site, and that it's ok to break TS typechecking for such sites and recommend site owners to add the missing dependencies.
If this was a bad decision, we can revert it.