Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughUpdates multiple tsconfig.json files to extend ../tsconfig.json instead of ../tsconfig.base.json, removes content from cjs-test/tsconfig.json, fixes a trailing comma in migration/tsconfig.json, adds a typed interface for ESLint restricted syntax arrays, bumps ESLint and adds @eslint/js, and introduces a Renovate grouping rule for ESLint. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev
participant Repo
participant CI
Dev->>Repo: Push tsconfig, ESLint, Renovate, package.json changes
Repo-->>CI: Trigger pipeline
CI->>CI: Use root tsconfig.json for subprojects
CI->>CI: Apply ESLint with typed restrictions
CI->>CI: Renovate groups ESLint updates per new rule
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 (4)
renovate.json (1)
15-19: Good Renovate grouping for ESLint; consider including Prettier integrations (optional)Grouping eslint with @eslint/* is correct and matches Renovate’s supported wildcards (as learned previously). Optionally, you may want to group eslint-config-prettier and eslint-plugin-prettier with ESLint updates, since they often move in tandem.
Apply this if you want them grouped together:
{ "groupName": "ESLint and its core modules", - "matchPackageNames": ["eslint", "@eslint/*"] + "matchPackageNames": ["eslint", "@eslint/*", "eslint-config-prettier", "eslint-plugin-prettier"] }eslint.config.ts (3)
20-35: Type it readonly and avoid false positives for node: built-ins
- Minor: prefer ReadonlyArray to prevent accidental mutation.
- Important: builtinModules typically includes both "fs" and "node:fs". Current selector would also flag correct imports like import 'node:fs' and suggest node:node:fs. Filter out the node: prefixed items.
Apply both in one go:
-const importConcerns: RestrictedSyntax[] = [ +const importConcerns: ReadonlyArray<RestrictedSyntax> = [ { selector: "ImportDeclaration[source.value='ramda'] > ImportSpecifier, " + "ImportDeclaration[source.value='ramda'] > ImportDefaultSpecifier", message: "use import * as R from 'ramda'", }, { selector: "ImportDeclaration[source.value=/^zod/] > ImportDefaultSpecifier", message: "do import { z } instead", }, - ...builtinModules.map((mod) => ({ + ...builtinModules + .filter((mod) => !mod.startsWith("node:")) + .map((mod) => ({ selector: `ImportDeclaration[source.value='${mod}']`, message: `use node:${mod} for the built-in module`, - })), + })), ];
37-64: Nit: use ReadonlyArray typing for consistency and safetySame reasoning as above—mark as read-only to avoid accidental mutations during future edits.
-const performanceConcerns: RestrictedSyntax[] = [ +const performanceConcerns: ReadonlyArray<RestrictedSyntax> = [
66-168: Mark tsFactoryConcerns as ReadonlyArray and sanity-check selectors
- Change the declaration to prevent accidental mutation while still allowing spread into rules:
-const tsFactoryConcerns: RestrictedSyntax[] = [ +const tsFactoryConcerns: ReadonlyArray<RestrictedSyntax> = [
- No code mutates this array, and ReadonlyArray still supports spread usage at line 242.
– After upgrading ESLint/TS-ESLint, spot-check a few selectors (e.g.
Identifier[name='KeyOfKeyword'],Literal[value='Promise']) against the AST emitted by@typescript-eslint/parser. A quick sample.tsfile run through your config will confirm they still fire as expected.
📜 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 ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
cjs-test/tsconfig.json(0 hunks)eslint.config.ts(3 hunks)esm-test/tsconfig.json(1 hunks)example/tsconfig.json(1 hunks)express-zod-api/tsconfig.json(1 hunks)issue952-test/tsconfig.json(1 hunks)migration/tsconfig.json(1 hunks)package.json(1 hunks)renovate.json(1 hunks)tools/tsconfig.json(1 hunks)zod-plugin/tsconfig.json(1 hunks)
💤 Files with no reviewable changes (1)
- cjs-test/tsconfig.json
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-06-14T16:42:52.972Z
Learnt from: RobinTail
PR: RobinTail/express-zod-api#2736
File: express-zod-api/tsup.config.ts:12-26
Timestamp: 2025-06-14T16:42:52.972Z
Learning: In express-zod-api tsup configurations, the direct mutation of `options.supported` in the `esbuildOptions` callback is intentional behavior and should not be flagged as a side effect issue.
Applied to files:
zod-plugin/tsconfig.jsonexpress-zod-api/tsconfig.json
📚 Learning: 2025-08-01T09:48:13.742Z
Learnt from: RobinTail
PR: RobinTail/express-zod-api#0
File: :0-0
Timestamp: 2025-08-01T09:48:13.742Z
Learning: In express-zod-api, when migrating from Zod v3 to v4, the correct approach for internal type imports is to change from `import type { $ZodType } from "zod/v4/core"` to `import { z } from "zod"` and then use `z.core.$ZodType`. The zod/v4/core module is reexported as z.core by the main zod package, making this a valid and working approach.
Applied to files:
express-zod-api/tsconfig.json
📚 Learning: 2025-06-02T21:08:56.475Z
Learnt from: RobinTail
PR: RobinTail/express-zod-api#2697
File: CHANGELOG.md:5-5
Timestamp: 2025-06-02T21:08:56.475Z
Learning: The `cjs-test` directory in the express-zod-api repository is a test workspace and should be excluded when checking for main project version consistency with changelog entries.
Applied to files:
express-zod-api/tsconfig.json
📚 Learning: 2025-05-28T18:58:10.064Z
Learnt from: RobinTail
PR: RobinTail/express-zod-api#2428
File: express-zod-api/src/index.ts:44-44
Timestamp: 2025-05-28T18:58:10.064Z
Learning: The type-only import `import type {} from "qs";` in express-zod-api/src/index.ts is necessary to avoid TS2742 errors for exported functions like attachRouting, makeRequestMock, testEndpoint, and testMiddleware that have types depending on types/qs. This import provides the reference TypeScript needs to infer portable type names.
Applied to files:
express-zod-api/tsconfig.jsoneslint.config.ts
📚 Learning: 2025-06-15T13:56:19.544Z
Learnt from: RobinTail
PR: RobinTail/express-zod-api#2746
File: renovate.json:6-13
Timestamp: 2025-06-15T13:56:19.544Z
Learning: In Renovate configuration, `matchPackageNames` supports wildcard patterns using glob syntax (e.g., `typescript-eslint/*`). There is no `matchPackagePatterns` field. The `groupName` property is required to group related packages into single PRs.
Applied to files:
renovate.json
🔇 Additional comments (8)
example/tsconfig.json (1)
2-2: Extending the root tsconfig.json: sanity-check parity with the old baseLooks good. Please confirm the root tsconfig.json preserves any critical options previously provided by tsconfig.base.json (paths, strictness, lib targets) to avoid subtle behavior drift in this package.
issue952-test/tsconfig.json (1)
2-2: Switch to root config: confirm relative path correctness and inherited optionsThe relative path looks correct. Please double-check that the root tsconfig.json provides the same declaration-related settings (or at least doesn’t override them unexpectedly) since this package emits d.ts only.
migration/tsconfig.json (1)
2-2: Good fix on trailing comma; confirm base-config parity after extend switch
- Trailing comma removal is correct JSON hygiene. LGTM.
- After switching extends to ../tsconfig.json, please verify no behavior changes vs the previous tsconfig.base.json (notably module/moduleResolution interplay and any base include/exclude).
Also applies to: 7-7
express-zod-api/tsconfig.json (1)
2-2: Root tsconfig.json present and stale references removed
- ✔️
tsconfig.jsonexists at the repository root- ✔️ No remaining references to
tsconfig.base.json- ✔️ All package-level
tsconfig.jsonfiles now extend"../tsconfig.json"tools/tsconfig.json (1)
2-2: No stale tsconfig.base.json references and TS version supports “bundler” resolution
- No lingering
"extends": "../tsconfig.base.json"entries ortsconfig.base.jsonfiles in the repo.- All
package.jsonTS versions are ≥ 5.1.3 (and some on “catalog:dev”), satisfying the ≥ 5.0 requirement formoduleResolution: "Bundler".- Existing tsconfig files correctly use
moduleResolution: "Bundler"and will work as expected.esm-test/tsconfig.json (1)
2-2: LGTM: consistent shift to root tsconfigExtending the root tsconfig.json keeps settings centralized. No issues spotted.
zod-plugin/tsconfig.json (1)
2-2: LGTM: aligns with repo-wide config consolidationExtending ../tsconfig.json is consistent with the PR objective. The local compilerOptions and exclude remain intact.
eslint.config.ts (1)
15-18: Nice: explicit typing for restricted-syntax entriesThe RestrictedSyntax interface tightens config shape and improves maintainability. Good addition.
|
eslint config file in compat test will remain JS, because TS-based one was added in 9.24.0 |
tsconfig and ESLint config in typescripttsconfig
This changes
tsconfig.base.jsontotsconfig.jsonin the root, so that it won't require extension in every workspace and TS files in root would be covered too