-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Build: Simplify tsconfig.json files #68326
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
); | ||
} catch ( e ) { | ||
console.error( | ||
`Error parsing package.json for package ${ packageName }` |
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.
Thank you for handling errors here.
Flaky tests detected in 8f4b91b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12506387253
|
@@ -1,10 +1,5 @@ | |||
{ | |||
"$schema": "https://json.schemastore.org/tsconfig.json", |
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.
While we are here, why do we need this "$schema" in ever tsconfig.json
file? Don't the IDEs and TS automatically infer that?
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.
I see that it was added in #59861
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.
Some might infer it based on the filename, but including it ensures that supporting environments will use the appropriate schema. There's little downside to including it and the benefits are significant.
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.
This is a nice clean up. I have been thinking about this for a while. Thank you for beating me.
We need to fix |
I have created #68346 following this one. |
What?
Simplify tsconfig.json files. TypeScript 5.5 introduced a
configDir
variable that can be used for templating tsconfig.json files. This can vastly reduce repitition in tsconfig.json files.src
instead ofsrc/**/*
).Why?
This removes a lot of repetition from tsconfig.json files.
Testing Instructions
CI passes. TSC should continue to work as expected locally.