chore(tsconfig.json): simplify 'include' patterns by consolidating file extensions and directory paths#9547
Conversation
|
View your CI Pipeline Execution ↗ for commit b75efe3
☁️ Nx Cloud last updated this comment at |
85055f5 to
bd8476c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9547 +/- ##
=======================================
Coverage 45.26% 45.26%
=======================================
Files 208 208
Lines 8340 8340
Branches 1895 1890 -5
=======================================
Hits 3775 3775
Misses 4118 4118
Partials 447 447 🚀 New features to boost your workflow:
|
…le extensions and directory paths
b4e2a78 to
b4707be
Compare
…s-consolidate-file-extensions-directory-paths
…s-consolidate-file-extensions-directory-paths
…s-consolidate-file-extensions-directory-paths
…s-consolidate-file-extensions-directory-paths
WalkthroughBroadened TypeScript include globs across root and multiple package tsconfig.json files from explicit *.config.js/ts (and granular file-type globs in some) to a unified pattern .config.. Several packages also simplified includes to directory-level entries (src, tests). No compilerOptions, references, or public API declarations were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (7)
packages/angular-query-devtools-experimental/tsconfig.json (1)
12-12: No nested config files detected; recursive glob remains optional
Current"*.config.*"covers all existing top-level configs. Switch to"**/*.config.*"only if you plan to add config files in subfolders.Apply:
- "include": ["src", "*.config.*", "package.json"], + "include": ["src", "**/*.config.*", "package.json"],packages/solid-query-persist-client/tsconfig.json (1)
9-9: Match nested configs and keep ordering consistent
- Use "**/.config." to catch configs under subdirs if they appear later.
- Tiny nit: keep include order consistent with other packages (src, test-setup.ts, configs, package.json) to reduce churn.
- "include": ["src", "test-setup.ts", "*.config.*", "package.json"], + "include": ["src", "test-setup.ts", "**/*.config.*", "package.json"],packages/eslint-plugin-query/tsconfig.json (1)
7-7: Support JS/ESM config files in this package
Override your tsconfig to type-check.js/.cjs/.mjsconfig files by addingallowJs: trueand using Node-style resolution. For example, in packages/eslint-plugin-query/tsconfig.json:"compilerOptions": { + "allowJs": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", "outDir": "./dist-ts", "rootDir": "." },[packages/eslint-plugin-query/tsconfig.json]
packages/angular-query-persist-client/tsconfig.json (1)
10-10: Make config glob recursive
Replace"*.config.*"with"**/*.config.*"in theincludeof tsconfig.json to ensure any moved or nested config files are picked up.packages/query-devtools/tsconfig.json (1)
9-9: Consider making tsconfig’s include pattern recursive for config files
Change the"*.config.*"matcher to"**/*.config.*"so any nested config files are picked up:- "include": ["src", "*.config.*", "package.json"], + "include": ["src", "**/*.config.*", "package.json"],tsconfig.json (1)
31-31: Heads-up: TS-config files may need Node types.
If any .ts config here imports Node built-ins, consider adding Node types at the root to avoid type errors.Optional:
"compilerOptions": { + "types": ["node"], ... },packages/react-query-devtools/tsconfig.json (1)
8-8: Disable allowJs or tighten include globRoot
tsconfig.jsonenables"allowJs": true, so the pattern*.config.*will also pull in JS-based configs (.config.js,.config.cjs,.config.mjs). To avoid unintended JS inclusion (and improve TS discovery performance), either add"allowJs": falseundercompilerOptionsinpackages/react-query-devtools/tsconfig.jsonor change the include to["src", "test-setup.ts", "*.config.ts", "package.json"].
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (25)
packages/angular-query-devtools-experimental/tsconfig.json(1 hunks)packages/angular-query-experimental/tsconfig.json(1 hunks)packages/angular-query-persist-client/tsconfig.json(1 hunks)packages/eslint-plugin-query/tsconfig.json(1 hunks)packages/query-async-storage-persister/tsconfig.json(1 hunks)packages/query-broadcast-client-experimental/tsconfig.json(1 hunks)packages/query-codemods/tsconfig.json(1 hunks)packages/query-core/tsconfig.json(1 hunks)packages/query-devtools/tsconfig.json(1 hunks)packages/query-persist-client-core/tsconfig.json(1 hunks)packages/query-sync-storage-persister/tsconfig.json(1 hunks)packages/query-test-utils/tsconfig.json(1 hunks)packages/react-query-devtools/tsconfig.json(1 hunks)packages/react-query-next-experimental/tsconfig.json(1 hunks)packages/react-query-persist-client/tsconfig.json(1 hunks)packages/react-query/tsconfig.json(1 hunks)packages/solid-query-devtools/tsconfig.json(1 hunks)packages/solid-query-persist-client/tsconfig.json(1 hunks)packages/solid-query/tsconfig.json(1 hunks)packages/svelte-query-devtools/tsconfig.json(1 hunks)packages/svelte-query-persist-client/tsconfig.json(1 hunks)packages/svelte-query/tsconfig.json(1 hunks)packages/vue-query-devtools/tsconfig.json(1 hunks)packages/vue-query/tsconfig.json(1 hunks)tsconfig.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-02T17:57:33.139Z
Learnt from: TkDodo
PR: TanStack/query#9612
File: packages/query-async-storage-persister/src/asyncThrottle.ts:0-0
Timestamp: 2025-09-02T17:57:33.139Z
Learning: When importing from tanstack/query-core in other TanStack Query packages like query-async-storage-persister, a workspace dependency "tanstack/query-core": "workspace:*" needs to be added to the package.json.
Applied to files:
packages/query-async-storage-persister/tsconfig.jsonpackages/query-core/tsconfig.json
📚 Learning: 2025-08-19T03:18:18.303Z
Learnt from: oscartbeaumont
PR: TanStack/query#9564
File: packages/solid-query-devtools/src/production.tsx:2-3
Timestamp: 2025-08-19T03:18:18.303Z
Learning: In the solid-query-devtools package, the codebase uses a pattern of type-only default imports combined with typeof for component type annotations (e.g., `import type SolidQueryDevtoolsComp from './devtools'` followed by `typeof SolidQueryDevtoolsComp`). This pattern is consistently used across index.tsx and production.tsx files, and the maintainers prefer consistency over changing this approach.
Applied to files:
packages/svelte-query/tsconfig.jsonpackages/query-devtools/tsconfig.jsonpackages/react-query-devtools/tsconfig.jsonpackages/solid-query-devtools/tsconfig.jsonpackages/react-query/tsconfig.jsonpackages/solid-query-persist-client/tsconfig.jsonpackages/svelte-query-devtools/tsconfig.jsonpackages/solid-query/tsconfig.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test
- GitHub Check: Preview
🔇 Additional comments (25)
packages/query-codemods/tsconfig.json (1)
7-7: Type checking for configuration files is enabled
Root tsconfig.json sets"allowJs": trueand"checkJs": trueand is extended by packages/query-codemods/tsconfig.json, so"*.config.*"will indeed include and type-check all.config.*files as intended.packages/query-test-utils/tsconfig.json (1)
7-7: No config declarations are emitted; no changes required.
Search fordist-ts/**/*config*.d.tsreturned no results—keeping"*.config.*"inincludeposes no risk.packages/react-query-next-experimental/tsconfig.json (2)
8-8: LGTM: consolidated config glob is correct and future-proofs extensionsExpands support to .js/.ts/.cjs/.mjs/.cts/.mts while keeping scope at package root. Looks good.
8-8: Retain current include – no nested config files detected
No*.config.*files live under any subfolders in this package, so the existing"*.config.*"glob suffices.packages/solid-query-devtools/tsconfig.json (2)
9-9: LGTM: simplified include pattern is consistent with repo directionBroadened to .config. without touching compilerOptions/refs. All good.
9-9: No test-setup.ts file found; tsconfig.json does not require updatepackages/angular-query-experimental/tsconfig.json (1)
10-10: LGTM: broadened config glob; scripts and test-setup remain explicitly includedNo behavior change beyond accepting additional config extensions; root-only glob aligns with prior intent.
packages/svelte-query-persist-client/tsconfig.json (2)
7-7: LGTM: folder-level includes replace recursive file globs cleanly"src" and "tests" coverage should still surface .svelte files to tooling that reads tsconfig includes (e.g., svelte-check).
7-7: Include patterns capture all .svelte files
The"include": ["src", "tests", "*.config.*", "package.json"]setting correctly picks up every.sveltefile undersrcandtests, as confirmed by thefdcheck.packages/query-persist-client-core/tsconfig.json (1)
7-7: LGTM: unified .config. keeps includes minimal and flexibleMatches the repo-wide pattern; no other tsconfig semantics changed.
packages/query-core/tsconfig.json (2)
7-7: LGTM: unified config glob is fine.
This picks up .js/.ts/.mjs/.cjs/.mts/.cts config files at the package root without affecting src inclusion.
7-7: No changes needed to tsconfig include The existing"*.config.*"pattern already matches all config files inpackages/query-core, and there are no nested config files to warrant switching to a recursive pattern.packages/angular-query-persist-client/tsconfig.json (1)
10-10: LGTM: broadened glob keeps intent, reduces churn.
No behavioral change expected; only more extensions covered at the package root.packages/query-devtools/tsconfig.json (1)
9-9: LGTM: consistent with repo-wide pattern.
Solid-specific JSX options remain untouched; only the include glob is unified.tsconfig.json (1)
31-31: LGTM: simpler root include.
Covers eslint/prettier and similar configs without hardcoding filenames.packages/query-async-storage-persister/tsconfig.json (2)
7-7: LGTM: matches the standardized pattern.
No impact on emitted declarations; just broader config matching at the package root.
7-7: No nested.config.*files detected; currentincludeis sufficient.packages/query-sync-storage-persister/tsconfig.json (1)
7-7: No ESM‐only config files present—include change is safe
This package defines no*.config.mjsor*.config.cjsat its root, so broadening to"*.config.*"won’t introduce new TS errors under the inherited ES2022/Bundler settings.packages/query-broadcast-client-experimental/tsconfig.json (1)
7-7: No .config.mjs/.config.cjs files detected; the"*.config.*"include won’t match any ESM configs in this package, so it’s safe to keep.packages/solid-query/tsconfig.json (1)
9-9: Verified no.config.mjs/.config.cjs files inpackages/solid-query; the"*.config.*"include is safe.packages/vue-query-devtools/tsconfig.json (1)
7-7: No .vue SFCs present; keep tsconfig include "src".packages/react-query-persist-client/tsconfig.json (1)
8-8: LGTM; no ESM config files presentNo *.config.mjs or *.config.cjs found and tsconfig.json doesn’t override module/moduleResolution (inherited from base). Changes align with repo-wide simplification.
packages/svelte-query-devtools/tsconfig.json (1)
7-7: No.sveltefiles in this package;"src"include is sufficient.packages/vue-query/tsconfig.json (1)
7-7: Approve tsconfig include update
Include patterns match other packages—unified"*.config.*"alongsidetest-setup.tsandpackage.jsonpreserves existing behavior and accommodates.mjs/.cjswhenallowJsis enabled; no Vue SFC includes were altered.packages/react-query/tsconfig.json (1)
8-8: LGTM; include pattern is consistent with other React packages.
| "*.config.ts", | ||
| "package.json" | ||
| ], | ||
| "include": ["src", "tests", "*.config.*", "package.json"], |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Preserve Svelte SFC coverage under tests and src
Directory-level "src"/"tests" may omit .svelte from the TS program. Keep explicit globs to avoid regressions in editor tooling and svelte-check.
Apply:
- "include": ["src", "tests", "*.config.*", "package.json"],
+ "include": ["src", "tests", "src/**/*.svelte", "tests/**/*.svelte", "*.config.*", "package.json"],Quick check:
🏁 Script executed:
#!/bin/bash
fd -e svelte packages/svelte-query/{src,tests} -x echo '{}'
# If any paths print, ensure svelte-check reports them with this tsconfig.Length of output: 487
🏁 Script executed:
#!/bin/bash
# Search for all .svelte files under src and tests directories
fd -e svelte . packages/svelte-query/src packages/svelte-query/tests -x echo {}Length of output: 1272
Include Svelte SFC globs in tsconfig.json include
In packages/svelte-query/tsconfig.json, update the include array to explicitly include .svelte files in both src and tests so that svelte-check and editor tooling pick them up:
- "include": ["src", "tests", "*.config.*", "package.json"],
+ "include": [
+ "src",
+ "tests",
+ "src/**/*.svelte",
+ "tests/**/*.svelte",
+ "*.config.*",
+ "package.json"
+ ],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "include": ["src", "tests", "*.config.*", "package.json"], | |
| "include": [ | |
| "src", | |
| "tests", | |
| "src/**/*.svelte", | |
| "tests/**/*.svelte", | |
| "*.config.*", | |
| "package.json" | |
| ], |
🤖 Prompt for AI Agents
In packages/svelte-query/tsconfig.json around line 7, the "include" array
doesn't explicitly include Svelte single-file components, so editor tooling and
svelte-check won't pick up .svelte files; update the include array to add globs
such as "src/**/*.svelte" and "tests/**/*.svelte" (or simply "**/*.svelte")
alongside the existing entries so SFCs in both src and tests are included.
…s-consolidate-file-extensions-directory-paths
Summary by CodeRabbit