-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
chore(tsconfig.json): narrow 'include' pattern to prevent TS6053 race conditions from tsup bundled config files #10522
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
Changes from 6 commits
5c9b445
af137b2
1eaaf69
fcf0247
dd0a099
c1b244c
60be407
2b16070
c38d48d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,6 @@ | |
| "outDir": "./dist-ts", | ||
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "*.config.*", "package.json"], | ||
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No. TypeScript’s tsconfig.json “include” glob syntax does not support brace expansion patterns like *.config.{ts,js,mjs,cjs}. Official TypeScript documentation states that “include”/“exclude” support only the wildcard characters * and ? and the special recursive token /, and it describes those as the supported glob wildcards. It does not mention brace/group expansion as supported. TypeScript’s own source for the include/exclude glob feature also lists supported tokens as , ?, and /, and explicitly notes that character escape sequences and character ranges are not supported—indicating that its glob syntax is intentionally limited rather than full brace-expansion syntax. Additionally, TypeScript maintainers have discussed brace usage not working in tsconfig patterns (e.g., curly braces not supported in glob patterns), corroborating that .{...} style expansion isn’t handled. Supported tokens (from TypeScript docs/source): - * matches zero or more characters (excluding directory separators) - ? matches any one character (excluding directory separators) - / recursively matches any subdirectory Therefore, to include multiple extensions in tsconfig.json, you need separate patterns (e.g., /.ts, /.js, etc.) rather than a single brace-expanded pattern. Citations:
Update TypeScript's Use separate patterns instead: "include": ["src", "*.config.ts", "*.config.js", "*.config.mjs", "*.config.cjs", "package.json"]🤖 Prompt for AI Agents |
||
| "references": [{ "path": "../query-persist-client-core" }] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,5 +4,5 @@ | |||||||||||||||||||
| "outDir": "./dist-ts", | ||||||||||||||||||||
| "rootDir": "." | ||||||||||||||||||||
| }, | ||||||||||||||||||||
| "include": ["src", "*.config.*", "package.json"] | ||||||||||||||||||||
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"] | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No. TypeScript’s official tsconfig.json include/exclude glob syntax does not support brace expansion patterns like ".config.{ts,js,mjs,cjs}". Supported wildcard syntax for include and exclude in tsconfig.json (per the TypeScript TSConfig Reference): - * matches zero or more characters (excluding directory separators) - ? matches any one character (excluding directory separators) - / matches any directory nested to any level TypeScript’s docs explicitly describe only those wildcard characters for glob patterns in include/exclude, and do not list any support for {a,b} brace expansion. Practical implication: to include multiple extensions, you must use separate patterns (for example, /.config.ts, /*.config.js, etc.) rather than {ts,js,...}. Citations:
Brace-expansion glob syntax is not supported in TypeScript The pattern Suggested fix- "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"]
+ "include": [
+ "src",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
+ "package.json"
+ ]📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| } | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,6 @@ | |
| "outDir": "./dist-ts", | ||
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "tests", "*.config.*", "package.json"], | ||
| "include": ["src", "tests", "*.config.{ts,js,mjs,cjs}", "package.json"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No. TypeScript’s tsconfig.json “include”/“exclude” glob patterns do not support brace expansion syntax like "*.config.{ts,js,mjs,cjs}". Officially, TypeScript documents that it supports only wildcard characters for tsconfig include/exclude patterns: *, ?, and / (and related rules). There is no mention of brace-expansion-style {a,b} patterns. Additionally, TypeScript’s own issue tracker records that “curly braces aren’t supported in our glob patterns”. What to do instead: spell out multiple patterns explicitly, e.g. include entries for *.config.ts, *.config.js, etc., or generate the expanded list with your tooling (since tsconfig itself won’t expand braces). Citations:
Brace expansion in TypeScript's Suggested fix- "include": ["src", "tests", "*.config.{ts,js,mjs,cjs}", "package.json"],
+ "include": [
+ "src",
+ "tests",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
+ "package.json"
+ ],🤖 Prompt for AI Agents |
||
| "references": [{ "path": "../query-devtools" }, { "path": "../svelte-query" }] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,6 @@ | |
| "outDir": "./dist-ts", | ||
| "rootDir": "." | ||
| }, | ||
| "include": ["src", "*.config.*", "package.json"], | ||
| "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: No, brace patterns like ".config.{ts,js,mjs,cjs}" are not supported in TypeScript tsconfig include. Only basic glob patterns "", "?", and "/" are supported, along with special handling for "." patterns where only supported file extensions are considered. To match multiple extensions like ts, js, mjs, cjs, you must list them separately: [".config.ts", ".config.js", ".config.mjs", ".config.cjs"]. Citations:
The pattern Proposed fix- "include": ["src", "*.config.{ts,js,mjs,cjs}", "package.json"],
+ "include": [
+ "src",
+ "*.config.ts",
+ "*.config.js",
+ "*.config.mjs",
+ "*.config.cjs",
+ "package.json"
+ ],🤖 Prompt for AI Agents |
||
| "references": [{ "path": "../vue-query" }, { "path": "../query-devtools" }] | ||
| } | ||
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.
🧩 Analysis chain
🌐 Web query:
Does TypeScript support brace expansion in tsconfig.jsonincludeglobs (e.g.,"*.config.{ts,js,mjs,cjs}")? Please cite official TypeScript documentation or source code behavior.💡 Result:
No. TypeScript’s tsconfig.json include/exclude glob patterns do not support Bash-style brace expansion like {ts,js,mjs,cjs}. TypeScript documents include as “filenames or patterns” and specifies only wildcard characters , ?, and / for its tsconfig globbing. The official docs list those supported wildcard characters and do not mention brace sets as a supported feature. Additionally, TypeScript’s own issue tracker documents that “curly braces aren't supported in our glob patterns” in the context of tsconfig include patterns. Practical implication: a pattern such as ".config.{ts,js,mjs,cjs}" will not be interpreted as multiple extensions by the TypeScript compiler; you need to spell out separate include patterns (e.g., ".config.ts", ".config.js", etc.) or use other mechanisms (like multiple tsconfig files / tooling) to cover those extensions.
Citations:
Brace expansion is not supported in
tsconfig.jsonincludeglobs—update Line 13 to use explicit patterns.TypeScript's glob patterns in
tsconfig.jsonsupport only*,?, and/wildcards. The pattern"*.config.{ts,js,mjs,cjs}"will not be interpreted as multiple extensions; use separate entries instead to ensure all intended config files are included.Suggested fix
"include": [ "src", "test-setup.ts", - "*.config.{ts,js,mjs,cjs}", + "*.config.ts", + "*.config.js", + "*.config.mjs", + "*.config.cjs", "package.json" ],📝 Committable suggestion
🤖 Prompt for AI Agents