Skip to content

Add noEmit to the base tsconfig#3048

Merged
RobinTail merged 1 commit intomasterfrom
fix-missing-noEmit
Nov 8, 2025
Merged

Add noEmit to the base tsconfig#3048
RobinTail merged 1 commit intomasterfrom
fix-missing-noEmit

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

@RobinTail RobinTail commented Nov 8, 2025

required with allowImportingTsExtensions

Summary by CodeRabbit

  • Chores
    • Updated TypeScript compiler configuration across project packages to modify build output behavior during compilation phases.

@RobinTail RobinTail added the CI/CD label Nov 8, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 8, 2025

Walkthrough

The changes consolidate TypeScript compilation configuration by removing --noEmit flags from multiple package.json pretest scripts and centralizing the configuration in tsconfig.json files. The root config adds noEmit: true, while issue952-test overrides it with noEmit: false.

Changes

Cohort / File(s) Summary
Package.json pretest script updates
example/package.json, express-zod-api/package.json, migration/package.json, zod-plugin/package.json
Removed --noEmit flag from pretest scripts, changing from "tsc --noEmit" to "tsc"
Root TypeScript configuration
tsconfig.json
Added "noEmit": true to compilerOptions
Issue952-test configuration
issue952-test/tsconfig.json
Added "noEmit": false to compilerOptions, overriding root config to allow emission

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • All changes follow a consistent, straightforward pattern of centralizing noEmit configuration
  • Changes are purely configurational with no logic modifications
  • The override in issue952-test/tsconfig.json should be verified to confirm it's intentional and necessary for that specific use case

Possibly related PRs

  • Root tsconfig #2890: Modifies the same issue952-test/tsconfig.json file, indicating coordinated TypeScript configuration changes across related PRs.

Poem

🐰 TypeScript configs scattered wide,
Now gathered where they should reside,
In root tsconfig, noEmit rules the day,
While issue952-test finds its own way!
Configuration clean, from here to there,
Order and harmony everywhere! 🎯

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding noEmit to the base tsconfig.json file, which is the primary modification observed across the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-missing-noEmit

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddaa900 and b4ab414.

📒 Files selected for processing (6)
  • example/package.json (1 hunks)
  • express-zod-api/package.json (1 hunks)
  • issue952-test/tsconfig.json (1 hunks)
  • migration/package.json (1 hunks)
  • tsconfig.json (1 hunks)
  • zod-plugin/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (17)
📓 Common learnings
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 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.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-09-29T03:35:55.561Z
Learning: In the express-zod-api repository, packages are built using tsdown before publishing. Source code with .ts extensions is not published - only the built JavaScript bundles and declaration files in the dist/ directory are published to npm. This means .ts extensions in source imports don't affect consumers.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2974
File: express-zod-api/src/zts-helpers.ts:2-3
Timestamp: 2025-09-29T06:00:10.830Z
Learning: tsdown handles module resolution and bundling independently of TypeScript's native compilation settings like rewriteRelativeImportExtensions, making such TypeScript emit-related configuration unnecessary when using tsdown for builds.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-09-28T10:09:35.674Z
Learning: In TypeScript configuration, when `strict: true` is set (including through extended configurations like tsconfig/node20), it automatically enables strictNullChecks along with other strict type-checking options, making explicit `strictNullChecks: true` redundant.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-09-28T10:09:35.674Z
Learning: In TypeScript configuration, when `strict: true` is set (including through extended configurations like tsconfig/node20), it automatically enables strictNullChecks along with other strict type-checking options, making explicit `strictNullChecks: true` redundant.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2546
File: compat-test/sample.ts:1-1
Timestamp: 2025-05-27T19:30:51.885Z
Learning: Files in compat-test/ directories, especially those named sample.ts or similar, are often test fixtures for migration scripts and may intentionally contain deprecated or "incorrect" code that the migration tooling is designed to fix. These should not be flagged as issues.
📚 Learning: 2025-09-29T03:35:55.561Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-09-29T03:35:55.561Z
Learning: In the express-zod-api repository, packages are built using tsdown before publishing. Source code with .ts extensions is not published - only the built JavaScript bundles and declaration files in the dist/ directory are published to npm. This means .ts extensions in source imports don't affect consumers.

Applied to files:

  • zod-plugin/package.json
  • tsconfig.json
  • example/package.json
  • migration/package.json
  • issue952-test/tsconfig.json
  • express-zod-api/package.json
📚 Learning: 2025-06-14T16:42:52.972Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 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/package.json
  • tsconfig.json
  • example/package.json
  • issue952-test/tsconfig.json
  • express-zod-api/package.json
📚 Learning: 2025-08-08T11:59:04.814Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2878
File: zod-plugin/runtime.ts:39-42
Timestamp: 2025-08-08T11:59:04.814Z
Learning: express-zod-api/zod-plugin/runtime.ts (TypeScript): Do not memoize the ZodType.prototype.brand getter. The current design returning setBrand.bind(this) on each access is intentional/preferred; avoid redefining "brand" as a data property per instance.

Applied to files:

  • zod-plugin/package.json
  • express-zod-api/package.json
📚 Learning: 2025-08-01T09:48:13.742Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 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:

  • zod-plugin/package.json
  • express-zod-api/package.json
📚 Learning: 2025-10-02T17:42:48.840Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-10-02T17:42:48.840Z
Learning: In express-zod-api v25 (ESM-only), the `.example()` method error occurs when user code runs as CommonJS. Express Zod API patches Zod's ESM bundle with `.example()`, but CommonJS code requires a separate CJS bundle instance that lacks this patch. Users must run their code as ESM by: (1) setting `"type": "module"` in package.json, (2) using `.mts` or `.mjs` file extensions, or (3) using tools like `tsx` or `vite-node` that provide their own ESM-compatible compilation.

Applied to files:

  • zod-plugin/package.json
  • migration/package.json
  • express-zod-api/package.json
📚 Learning: 2025-09-29T06:00:16.488Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2974
File: express-zod-api/src/documentation-helpers.ts:48-48
Timestamp: 2025-09-29T06:00:16.488Z
Learning: In the express-zod-api repository, the project uses pnpm workspaces with autoInstallPeers: false, meaning peerDependencies are not installed. The actual TypeScript version used for development comes from devDependencies which references "catalog:dev" in pnpm-workspace.yaml where it's set to a recent version (^5.9.2), not the peerDependency version which is just the minimum consumer requirement.

Applied to files:

  • zod-plugin/package.json
  • example/package.json
  • migration/package.json
  • express-zod-api/package.json
📚 Learning: 2025-06-02T21:08:56.475Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 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:

  • zod-plugin/package.json
  • migration/package.json
  • express-zod-api/package.json
📚 Learning: 2025-05-28T18:58:10.064Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 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:

  • zod-plugin/package.json
  • express-zod-api/package.json
📚 Learning: 2025-05-27T19:35:57.357Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2546
File: express-zod-api/tests/buffer-schema.spec.ts:32-37
Timestamp: 2025-05-27T19:35:57.357Z
Learning: In the express-zod-api project, tests are run from the `express-zod-api` workspace directory, and the project uses an ESM-first environment without `__dirname`. Relative paths like `../logo.svg` in test files correctly resolve to the repository root due to this test execution context.

Applied to files:

  • zod-plugin/package.json
  • migration/package.json
  • express-zod-api/package.json
📚 Learning: 2025-06-02T21:11:20.768Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2697
File: CHANGELOG.md:5-5
Timestamp: 2025-06-02T21:11:20.768Z
Learning: In the express-zod-api repository, RobinTail follows a release workflow where package.json version is only updated on the master branch after merging all planned release changes. Changelog entries may show future version numbers while package.json remains at the previous version during feature development, and this is intentional workflow, not a version inconsistency that needs to be flagged.

Applied to files:

  • zod-plugin/package.json
  • migration/package.json
  • express-zod-api/package.json
📚 Learning: 2025-09-29T06:00:10.830Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2974
File: express-zod-api/src/zts-helpers.ts:2-3
Timestamp: 2025-09-29T06:00:10.830Z
Learning: tsdown handles module resolution and bundling independently of TypeScript's native compilation settings like rewriteRelativeImportExtensions, making such TypeScript emit-related configuration unnecessary when using tsdown for builds.

Applied to files:

  • tsconfig.json
  • issue952-test/tsconfig.json
📚 Learning: 2025-09-28T10:09:35.674Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-09-28T10:09:35.674Z
Learning: In TypeScript configuration, when `strict: true` is set (including through extended configurations like tsconfig/node20), it automatically enables strictNullChecks along with other strict type-checking options, making explicit `strictNullChecks: true` redundant.

Applied to files:

  • tsconfig.json
  • issue952-test/tsconfig.json
📚 Learning: 2025-09-29T06:06:58.605Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2974
File: migration/tsconfig.json:2-2
Timestamp: 2025-09-29T06:06:58.605Z
Learning: tsconfig/node20 includes "moduleResolution": "node16" in its base configuration, along with other settings like "module": "nodenext", "target": "es2022", and "strict": true. When extending from tsconfig/node20, explicit moduleResolution configuration is not needed.

Applied to files:

  • tsconfig.json
  • issue952-test/tsconfig.json
📚 Learning: 2025-09-29T06:06:58.605Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2974
File: migration/tsconfig.json:2-2
Timestamp: 2025-09-29T06:06:58.605Z
Learning: tsconfig/node20 includes "moduleResolution": "node16" in its base configuration, along with other settings. When extending from tsconfig/node20, explicit moduleResolution configuration is not needed as it's provided by the preset.

Applied to files:

  • tsconfig.json
  • issue952-test/tsconfig.json
📚 Learning: 2025-05-27T19:30:51.885Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2546
File: compat-test/sample.ts:1-1
Timestamp: 2025-05-27T19:30:51.885Z
Learning: Files in compat-test/ directories, especially those named sample.ts or similar, are often test fixtures for migration scripts and may intentionally contain deprecated or "incorrect" code that the migration tooling is designed to fix. These should not be flagged as issues.

Applied to files:

  • migration/package.json
  • issue952-test/tsconfig.json
📚 Learning: 2025-05-27T20:03:34.213Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2546
File: example/factories.ts:35-42
Timestamp: 2025-05-27T20:03:34.213Z
Learning: The `./example` directory in the express-zod-api repository contains demonstration code for educational purposes only, not intended for production use. Example code can make simplified assumptions for brevity and clarity, and should not be flagged for missing production-level error handling, security measures, or edge case handling.

Applied to files:

  • migration/package.json
🔇 Additional comments (6)
tsconfig.json (1)

6-6: Configuration requirement correctly implemented.

Adding noEmit: true is the correct and required companion to allowImportingTsExtensions: true. TypeScript requires this pairing to validate .ts extension imports without attempting emission. Since the project uses tsdown for actual production builds, type-checking-only behavior in the base config is appropriate.

example/package.json (1)

11-11: Redundant CLI flag removal is appropriate.

The --noEmit flag is now redundant given noEmit: true in the root tsconfig.json. This simplification reduces duplication while maintaining identical behavior.

issue952-test/tsconfig.json (1)

5-5: Override correctly enables declaration-only emission for this test configuration.

The noEmit: false override with emitDeclarationOnly: true allows this test environment to emit .d.ts files while suppressing .js output, overriding the base config's noEmit: true. This is a valid and necessary configuration for test-specific requirements.

zod-plugin/package.json (1)

19-19: Consistent with centralized noEmit configuration.

This script change mirrors the refactoring in other packages—removing the redundant --noEmit flag since the setting is now centralized in the root tsconfig.json.

express-zod-api/package.json (1)

20-20: Consistent redundancy elimination across packages.

Removes the now-redundant --noEmit CLI flag. The setting is centralized in tsconfig.json.

migration/package.json (1)

18-18: Consistent with repository-wide configuration consolidation.

Removes redundant --noEmit flag as part of centralizing the setting in root tsconfig.json.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RobinTail RobinTail marked this pull request as ready for review November 8, 2025 07:03
@coveralls-official
Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same
when pulling b4ab414 on fix-missing-noEmit
into ddaa900 on master.

@RobinTail RobinTail merged commit 65a0713 into master Nov 8, 2025
13 checks passed
@RobinTail RobinTail deleted the fix-missing-noEmit branch November 8, 2025 07:07
@coderabbitai coderabbitai Bot mentioned this pull request Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant