Skip to content

Commit

Permalink
fix: remove composite: true from tsconfigs
Browse files Browse the repository at this point in the history
We are only using `references` in a solution-style tsconfig.
According to discussions at microsoft/TypeScript#60465,
such usage doesn't require `composite: true` to be set in sub-configs.

Removing this field loosens the constraints on these configs that all
files to be explicitly listed in `files` or `includes`.

After this change, type errors in source code would only be reported
twice if they're also imported by unit test specs, in contrast to
always be reported twice prior to the change.
I know this is not ideal yet, but it's still an improvement, and might
help catch some edge cases such as vuejs#437 (comment)

In the long run, we should still keep an eye on vuejs#549
(pending vuejs/language-tools#4750).
Cross-referencing might be a more intuitive configuration, and should be
the desirable configuration if we opt into Vitest Browser Mode.
  • Loading branch information
haoqunjiang committed Dec 12, 2024
1 parent fb5d851 commit 3b7a7fc
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion template/tsconfig/base/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",

"paths": {
Expand Down
1 change: 0 additions & 1 deletion template/tsconfig/base/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",

Expand Down
1 change: 0 additions & 1 deletion template/tsconfig/cypress-ct/tsconfig.cypress-ct.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
],
"exclude": [],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.cypress-ct.tsbuildinfo"
}
}
1 change: 0 additions & 1 deletion template/tsconfig/nightwatch-ct/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",

"paths": {
Expand Down
1 change: 0 additions & 1 deletion template/tsconfig/nightwatch/nightwatch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "@tsconfig/node22/tsconfig.json",
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "../node_modules/.tmp/tsconfig.nightwatch.tsbuildinfo",

Expand Down
2 changes: 1 addition & 1 deletion template/tsconfig/vitest/tsconfig.vitest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "./tsconfig.app.json",
"include": ["src/**/__tests__/*", "env.d.ts"],
"exclude": [],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",

"lib": [],
Expand Down

0 comments on commit 3b7a7fc

Please sign in to comment.