Skip to content

Conversation

@ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Sep 17, 2025

Summary

When isolatedModules option was introduced, the purpose was to indicate that it is a way to enable "transpilation mode", which is similar to other tools like Babel, swc, esbuild are doing.

However, this created a big misunderstanding and confusion between isolatedModules option in tsconfig vs ts-jest option. Therefore, ts-jest renamed isolatedModules option to transpilation to make things clearer

Closes #5013
Closes #4859

Test plan

Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

Summary by CodeRabbit

  • New Features

    • Introduced transpilation option to speed up TypeScript processing (per-file transpile, no type-checking).
    • Presets and examples now support transpilation across CJS/ESM configurations.
  • Documentation

    • Replaced isolatedModules with transpilation across guides and API references.
    • Added docs entries for transpilation, stringifyContentPathRegex, and useESM.
    • Updated preset examples to non-legacy APIs (createDefaultPreset, etc.).
  • Chores

    • Migrated configs and scripts in examples/e2e to use transpilation; removed isolated tsconfig files.
    • Updated user-facing messages to reference transpilation.

@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Replaces isolatedModules usage with a new transpilation option across configs, examples, and docs. Updates ts-jest config builders and warnings. Removes numerous “-isolated/-transpiler tsconfig” files and points Jest transforms to base tsconfigs while enabling transpilation: true. Adjusts compiler/config logic and messages accordingly; updates tests and site docs.

Changes

Cohort / File(s) Summary
Core logic and types
src/types.ts, src/legacy/config/config-set.ts, src/legacy/compiler/ts-compiler.ts, src/utils/messages.ts
Introduce TsJestGlobalOptions.transpilation?: boolean; compute isolation from options.isolatedModules ?? options.transpilation; adjust compiler warning to use configSet.isolatedModules; update help/deprecation messages to favor transpilation and consolidate deprecations.
Core tests
src/legacy/compiler/ts-compiler.spec.ts, src/legacy/config/config-set.spec.ts
Switch tests to transpilation: true paths, rework diagnostics mocks/assertions, update expected deprecation to ReplaceIsolatedModulesWithTranspilation, remove interpolate usage.
Root Jest config
jest.config.ts
Add transpilation: true in ts-jest options and remove tsconfig.isolatedModules.
E2E Jest configs (enable transpilation)
e2e/*/jest-transpiler-*.config.ts, e2e/esm-features/jest-compiler-esm.config.ts
Change tsconfig paths from “-transpiler.spec.json” to base “.spec.json” (some with ../), add transpilation: true; preserve useESM where present.
E2E test update
e2e/const-enum/__tests__/const-enum.spec.ts
Inline enum reads; remove helper functions; rename test description.
E2E removed tsconfigs
e2e/**/tsconfig-*-transpiler.spec.json
Delete isolatedModules-specific tsconfig overrides across multiple e2e suites.
Examples: Jest configs
examples/**/jest-*-transpiler.config.ts, examples/monorepo-app/jest-*.config.ts, examples/monorepo-app/type-*/jest-*.config.ts
Replace tsconfig: '...-isolated...' with transpilation: true; switch ESM presets to base tsconfig-esm.json; add new monorepo transpiler configs.
Examples: scripts
examples/*/package.json, examples/package.json
Replace test-isolated/test-esm-isolated scripts with test-transpiler/test-esm-transpiler referencing new configs.
Examples: removed tsconfigs
examples/**/tsconfig*-isolated*.json
Delete isolatedModules-oriented tsconfig files in examples (root, ESM, per-package).
Website docs (current)
website/docs/getting-started/options.md, website/docs/getting-started/options/transpilation.md, website/docs/getting-started/presets.md
Rename option isolatedModules → transpilation; update options table, examples, preset API names (legacy → standard), and related references; add stringifyContentPathRegex and useESM entries.
Website docs (versioned 29.4)
website/versioned_docs/version-29.4/getting-started/options*.md, .../presets.md
Apply same rename and additions in versioned docs; update interface snippets and references.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Jest as Jest
  participant TJ as ts-jest
  participant CS as ConfigSet
  participant TC as TsCompiler
  Note over Jest,TJ: Test startup
  Jest->>TJ: Load transformer with config
  TJ->>CS: Build ConfigSet(options)
  CS-->>TJ: returns { isolatedModules := options.isolatedModules ?? options.transpilation ?? false }
  TJ->>TC: getCompiledOutput(file, CS)
  alt module is Node16/Next AND !CS.isolatedModules
    TC-->>TJ: warn(Helps.UsingModernNodeResolution)
  end
  alt CS.isolatedModules (via transpilation)
    TC->>TC: transpileModule(...)
  else
    TC->>TC: type-check + compile (program)
  end
  TC-->>Jest: transformed code + diagnostics (if any)
  Jest-->>Jest: run tests
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • kulshekhar

Poem

A rabbit taps the keys—transpilation, not the old,
No more isolated burrows in the configs of cold.
Warnings trimmed, presets primmed, docs hop in line,
Tests now scamper swiftly—carrots crisp, divine.
With ears up high and builds made light,
I thump “it’s green!” into the night. 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately and concisely names the primary change: deprecating ts-jest's isolatedModules option and introducing the new transpilation option; it directly reflects the large set of changes to types, messages, configs, tests, and docs in this PR. The phrasing is specific and actionable and avoids vague terms, so a teammate scanning history will understand the main intent. Therefore the title meets the repository's guideline for a clear single-sentence summary.
Linked Issues Check ✅ Passed The changes introduce a new transpilation option, add it to public types, update messaging and deprecations, and decouple behavior from tsconfig.isolatedModules by deriving isolation from ts-jest options; this directly addresses issue #4859 (ensuring test-time type checking is not disabled by tsconfig.isolatedModules). The warning logic and text were also updated to depend on the runtime config and to recommend enabling transpilation in ts-jest, which aligns with the remediation direction for issue #5013. Based on the diffs to ts-compiler, config-set, types, tests, and docs, the PR implements the intended fixes for both linked issues.
Out of Scope Changes Check ✅ Passed I reviewed the file-level summaries and the changes are consistently focused on replacing/deprecating isolatedModules with transpilation and updating associated configs, docs, tests, and examples to the new option and presets; I did not find unrelated functional changes outside that scope. Some example and docs renames (preset naming and script names) are wide-reaching but appear to be coordinated documentation/configuration updates rather than unrelated feature work. Overall the changes are within the stated objective of clarifying and migrating isolatedModules → transpilation.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/isolated-modules

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

@ahnpnl ahnpnl force-pushed the fix/isolated-modules branch from 70f9acb to 34a3bee Compare September 17, 2025 09:38
@github-actions
Copy link

github-actions bot commented Sep 17, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-09-17 11:39 UTC

…tion

When `isolatedModules` option was introduced, the purpose was to indicate that it is a way to enable "transpilation mode", which is similar to other tools like `Babel`, `swc`, `esbuild` are doing.

However, this created a big misunderstanding and confusion between `isolatedModules` option in `tsconfig` vs `ts-jest` option. Therefore, `ts-jest` renamed `isolatedModules` option to `transpilation` to make things clearer
@ahnpnl ahnpnl force-pushed the fix/isolated-modules branch from 34a3bee to f76b332 Compare September 17, 2025 10:02
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 17, 2025

@ahnpnl ahnpnl marked this pull request as ready for review September 17, 2025 10:17
@ahnpnl ahnpnl requested a review from kulshekhar as a code owner September 17, 2025 10:17
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
examples/ts-only/package.json (1)

7-9: Same version‑alignment concern as js-with-ts.

This example also has jest: ^30.x with ts-jest: ^29.x; please align majors across examples.

examples/js-with-babel/package.json (1)

7-9: Same version‑alignment concern as js-with-ts.

Jest: ^30.x with ts-jest: ^29.x; align majors for consistency and to avoid peer issues.

🧹 Nitpick comments (18)
e2e/const-enum/__tests__/const-enum.spec.ts (1)

5-7: Test title is misleading about mode; suggest neutral wording

This spec likely runs under both compiler and transpilation configs; title implies only non‑transpilation.

-  it('should pass with non transpilation mode', () => {
+  it('should inline const enums', () => {
examples/ts-only/jest-esm-transpiler.config.ts (1)

7-8: Prefer /tsconfig-esm.json for tsconfig path (optional nit)

examples/ts-only/tsconfig-esm.json exists.

-    tsconfig: 'tsconfig-esm.json',
+    tsconfig: '<rootDir>/tsconfig-esm.json',
examples/js-with-ts/jest-esm-transpiler.config.ts (1)

7-8: Use /tsconfig-esm.json for path consistency (optional nit)

File: examples/js-with-ts/jest-esm-transpiler.config.ts (lines 7-8)

-    tsconfig: 'tsconfig-esm.json',
+    tsconfig: '<rootDir>/tsconfig-esm.json',
examples/package.json (1)

15-15: Make workspace runs resilient to missing scripts.

If any workspace hasn’t been updated yet, these commands may fail. Add --if-present to avoid breaking the aggregate run.

-    "test-transpiler": "npm run test-transpiler --workspaces",
+    "test-transpiler": "npm run test-transpiler --workspaces --if-present",
-    "test-esm-transpiler": "npm run test-esm-transpiler --workspaces",
+    "test-esm-transpiler": "npm run test-esm-transpiler --workspaces --if-present",

Also applies to: 17-17

website/docs/getting-started/options/transpilation.md (1)

5-7: Tighten wording and grammar; add clarity.

Minor copyedits for readability and precision.

-By default `ts-jest` uses TypeScript Compiler API aka full `Program` in the context of a project (yours), with full type-checking and features.
-But it can also be used to compile each file separately, which is usually named as `transpilation` like other tools `Babel`, `swc`, `esbuild` etc.
-That's what the `transpilation` option (which defaults to `false`) does.
+By default, `ts-jest` uses the TypeScript Compiler API (full `Program` in your project context) with full type checking.
+It can also compile each file independently, commonly called “transpilation” (similar to Babel, swc, esbuild).
+The `transpilation` option enables that mode (default: `false`).

-You'll lose type-checking ability and all [TypeScript limitations](https://www.typescriptlang.org/tsconfig/#isolatedModules) are applied in trading off for faster test running.
+You lose type checking, and the [TypeScript isolatedModules limitations](https://www.typescriptlang.org/tsconfig/#isolatedModules) apply, in exchange for faster test runs.

-Here is the example how to use the option
+Here is an example of how to use the option

-Using `transpilation: false` comes with a cost of performance comparing to `transpilation: true`. There is a way
+`transpilation: false` is slower than `transpilation: true`. You can

Optional: add a short note that users should run a separate “type check” step (e.g., tsc --noEmit) when using transpilation.

Also applies to: 9-11, 37-37

src/legacy/compiler/ts-compiler.ts (1)

196-198: Reduce noisy warning: emit “UsingModernNodeResolution” once per process.

This warning will trigger on every file compile when in non‑transpilation mode with Node16/NodeNext, recreating the noise complained in #5013. Guard it so it logs once.

Apply this localized change:

@@
-    if (isModernNodeModuleKind(this._initialCompilerOptions.module) && !this.configSet.isolatedModules) {
-      this._logger.warn(Helps.UsingModernNodeResolution)
-    }
+    if (
+      isModernNodeModuleKind(this._initialCompilerOptions.module) &&
+      !this.configSet.isolatedModules &&
+      !hasWarnedUsingModernNodeResolution
+    ) {
+      this._logger.warn(Helps.UsingModernNodeResolution)
+      hasWarnedUsingModernNodeResolution = true
+    }

And add a module‑scope flag near the other top‑level consts:

// Log this guidance once to avoid per-file noise in large projects
let hasWarnedUsingModernNodeResolution = false
src/types.ts (3)

80-83: Deprecation note reads well; add version metadata.

Consider adding “since” and “removal” versions to the deprecation tag to ease migration.

-  /**
-   * @deprecated use {@link transpilation} instead
-   */
+  /**
+   * @deprecated use {@link transpilation} instead
+   * @since 29.5.0
+   * @removal Next major
+   */

84-90: JSDoc nit + clarify behavior (type-checking disabled).

Fix the stray closing parenthesis and clarify that enabling this uses TypeScript.transpileModule (no type-checking).

-  /**
-   * Compiles files using {@link _ts.transpileModule})
-   *
-   * @default `undefined` (disables)
-   */
+  /**
+   * Compiles files using {@link _ts.transpileModule}, i.e. transpilation-only (no type-checking).
+   *
+   * @default `undefined` (disabled)
+   */

84-90: Also align related docs: diagnostics comment still mentions isolatedModules.

Where you describe diagnostics a few lines below, replace the reference to “less to be reported if isolatedModules is true” with “when transpilation is enabled”.

-  /**
-   * TS diagnostics - less to be reported if `isolatedModules` is `true`. It can be:
+  /**
+   * TS diagnostics — fewer will be reported when `transpilation` is enabled. It can be:
website/versioned_docs/version-29.4/getting-started/presets.md (3)

130-136: Fix example preset name and a small typo.

  • Use createDefaultLegacyPreset in the legacy example.
  • Remove stray character in comment.
-import { createDefaultLegacyPreset, type JestConfigWithTsJest } from 'ts-jest'
-
-const presetConfig = createDefaultPreset({
-  //...optionsa
+import { createDefaultLegacyPreset, type JestConfigWithTsJest } from 'ts-jest'
+
+const presetConfig = createDefaultLegacyPreset({
+  //...options
 })

61-66: Escape the dot in the transform regex.

To match .tsx? correctly, escape the dot.

-    '^.+.tsx?$': ['ts-jest', TsJestTransformerOptions]
+    '^.+\\.tsx?$': ['ts-jest', TsJestTransformerOptions]

33-36: Good rename to transpilation; add a brief cross-note about type checking.

Across these option blocks you added transpilation?: boolean. Consider a one‑liner note that enabling it disables type checking at test time and recommend running tsc --noEmit in CI. Keeps expectations clear.

Also applies to: 92-97, 151-156, 209-214, 269-274, 329-333, 385-390, 444-449, 501-507, 562-568, 621-627, 682-688

website/versioned_docs/version-29.4/getting-started/options/transpilation.md (2)

5-12: Tighten wording and grammar.

Minor phrasing tweaks for clarity.

-By default `ts-jest` uses TypeScript Compiler API aka full `Program` in the context of a project (yours), with full type-checking and features.
-But it can also be used to compile each file separately, which is usually named as `transpilation` like other tools `Babel`, `swc`, `esbuild` etc.
-That's what the `transpilation` option (which defaults to `false`) does.
+By default, `ts-jest` uses the TypeScript Compiler API (a full project `Program`) with type checking.
+It can also compile each file independently—commonly called “transpilation,” similar to tools like Babel, swc, or esbuild.
+That’s what the `transpilation` option does (default: `false`).
@@
-You'll lose type-checking ability and all [TypeScript limitations](https://www.typescriptlang.org/tsconfig/#isolatedModules) are applied in trading off for faster test running.
+You’ll lose type checking and accept the [TypeScript isolatedModules limitations](https://www.typescriptlang.org/tsconfig/#isolatedModules) in exchange for faster test runs.
@@
-Here is the example how to use the option
+Here is an example of how to use this option:

37-41: Performance section phrasing nits.

Improve flow and hyphenation.

-Using `transpilation: false` comes with a cost of performance comparing to `transpilation: true`. There is a way
+Using `transpilation: false` is slower than `transpilation: true`. You can
 to improve the performance when using this mode by changing the value of `include` in `tsconfig` which is used by `ts-jest`.
-The least amount of files which are provided in `include`, the more performance the test run can gain.
+The fewer files you include, the better the test performance.
@@
-Limiting the amount of files loaded via `include` can greatly boost performance when running tests. However, the trade off
+Limiting the files loaded via `include` can greatly boost performance when running tests. However, the trade‑off
 is `ts-jest` might not recognize all files which are intended to use with `jest`. One can run into issues with custom typings,
 global modules, etc...
 
-The suggested solution is what is needed for the test environment should be captured by
+The suggested solution is to ensure everything needed by the test environment is captured by
 glob patterns in `include`, to gain both performance boost and avoid breaking behaviors.

Also applies to: 52-58

src/legacy/config/config-set.spec.ts (1)

1153-1170: Avoid potential flakiness: use mockReturnValue instead of mockReturnValueOnce

If ConfigSet ends up calling ts.findConfigFile more than once, the single-shot mock may not hold.

Apply:

-      spyFindTsConfigFile.mockReturnValueOnce(undefined)
+      spyFindTsConfigFile.mockReturnValue(undefined)

Optionally assert only one deprecation log is emitted to catch duplicate warnings.

src/legacy/compiler/ts-compiler.spec.ts (1)

141-147: Transpilation-path tests — LGTM

  • Enabling transpilation: true and asserting compiler options/diagnostics behavior is appropriate.
  • Node16/NodeNext branch correctly uses tsTranspileModule.

Minor: rename describe('isolatedModules true'|false) to 'transpilation: true'|'transpilation: false' to avoid confusion during future maintenance.

Also applies to: 177-222, 228-246

src/utils/messages.ts (1)

31-31: Fix message accuracy and grammar

  • “Node16/18/Next” is incorrect; TS has Node16 and NodeNext.
  • Typo “in for”.

Apply:

-  UsingModernNodeResolution = 'Using hybrid module kind (Node16/18/Next) is only supported in "transpilation: true". Please set "transpilation: true" in for `ts-jest` config in your Jest config file.',
+  UsingModernNodeResolution = 'Using hybrid module kind (Node16/NodeNext) is only supported with "transpilation: true". Please set "transpilation: true" in the `ts-jest` config in your Jest config file.',
website/docs/getting-started/presets.md (1)

132-134: Fix example: wrong factory and a typo

This legacy section should call createDefaultLegacyPreset and the comment has a typo.

Apply:

-import { createDefaultLegacyPreset, type JestConfigWithTsJest } from 'ts-jest'
+import { createDefaultLegacyPreset, type JestConfigWithTsJest } from 'ts-jest'

-const presetConfig = createDefaultPreset({
-  //...optionsa
+const presetConfig = createDefaultLegacyPreset({
+  //...options
})
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54dee26 and f76b332.

📒 Files selected for processing (89)
  • e2e/const-enum/__tests__/const-enum.spec.ts (1 hunks)
  • e2e/const-enum/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/const-enum/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/const-enum/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/const-enum/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/enum/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/enum/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/enum/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/enum/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/esm-features/jest-compiler-esm.config.ts (1 hunks)
  • e2e/esm-features/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/esm-features/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/extend-ts-jest/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/extend-ts-jest/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/extend-ts-jest/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/extend-ts-jest/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/hoist-jest/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/hoist-jest/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/presets/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/presets/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/presets/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/presets/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/source-map/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/source-map/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/source-map/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/source-map/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/test-utils/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/test-utils/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/test-utils/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/test-utils/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/transform-js/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/transform-js/jest-transpiler-esm.config.ts (1 hunks)
  • e2e/transform-js/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/transform-js/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/transformer-in-ts/jest-transpiler-cjs.config.ts (1 hunks)
  • e2e/transformer-in-ts/jest-transpiler-esm.config.ts (2 hunks)
  • e2e/transformer-in-ts/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/transformer-in-ts/tsconfig-esm-transpiler.spec.json (0 hunks)
  • e2e/transformer-options/jest-transpiler-cjs.config.ts (2 hunks)
  • e2e/transformer-options/jest-transpiler-esm.config.ts (2 hunks)
  • e2e/transformer-options/tsconfig-cjs-transpiler.spec.json (0 hunks)
  • e2e/transformer-options/tsconfig-esm-transpiler.spec.json (0 hunks)
  • examples/js-with-babel/jest-esm-transpiler.config.ts (1 hunks)
  • examples/js-with-babel/jest-transpiler.config.ts (1 hunks)
  • examples/js-with-babel/package.json (1 hunks)
  • examples/js-with-babel/tsconfig-esm-isolated.json (0 hunks)
  • examples/js-with-babel/tsconfig-isolated.json (0 hunks)
  • examples/js-with-ts/jest-esm-transpiler.config.ts (1 hunks)
  • examples/js-with-ts/jest-transpiler.config.ts (1 hunks)
  • examples/js-with-ts/package.json (1 hunks)
  • examples/js-with-ts/tsconfig-esm-isolated.json (0 hunks)
  • examples/js-with-ts/tsconfig-isolated.json (0 hunks)
  • examples/monorepo-app/jest-esm-isolated.config.ts (0 hunks)
  • examples/monorepo-app/jest-esm-transpiler.config.ts (1 hunks)
  • examples/monorepo-app/jest-isolated.config.ts (0 hunks)
  • examples/monorepo-app/jest-transpiler.config.ts (1 hunks)
  • examples/monorepo-app/package.json (1 hunks)
  • examples/monorepo-app/type-commonjs/jest-esm-transpiler.config.ts (1 hunks)
  • examples/monorepo-app/type-commonjs/jest-transpiler.config.ts (1 hunks)
  • examples/monorepo-app/type-commonjs/tsconfig-esm-isolated.json (0 hunks)
  • examples/monorepo-app/type-commonjs/tsconfig-isolated.json (0 hunks)
  • examples/monorepo-app/type-module/jest-esm-transpiler.config.ts (1 hunks)
  • examples/monorepo-app/type-module/jest-transpiler.config.ts (1 hunks)
  • examples/monorepo-app/type-module/tsconfig-esm-isolated.json (0 hunks)
  • examples/monorepo-app/type-module/tsconfig-isolated.json (0 hunks)
  • examples/package.json (1 hunks)
  • examples/react-app/jest-esm-transpiler.config.ts (1 hunks)
  • examples/react-app/jest-transpiler.config.ts (1 hunks)
  • examples/react-app/package.json (1 hunks)
  • examples/react-app/tsconfig-esm-isolated.spec.json (0 hunks)
  • examples/react-app/tsconfig-isolated.spec.json (0 hunks)
  • examples/ts-only/jest-esm-transpiler.config.ts (1 hunks)
  • examples/ts-only/jest-transpiler.config.ts (1 hunks)
  • examples/ts-only/package.json (1 hunks)
  • examples/ts-only/tsconfig-esm-isolated.json (0 hunks)
  • examples/ts-only/tsconfig-isolated.json (0 hunks)
  • jest.config.ts (1 hunks)
  • src/legacy/compiler/ts-compiler.spec.ts (3 hunks)
  • src/legacy/compiler/ts-compiler.ts (1 hunks)
  • src/legacy/config/config-set.spec.ts (3 hunks)
  • src/legacy/config/config-set.ts (1 hunks)
  • src/types.ts (1 hunks)
  • src/utils/messages.ts (2 hunks)
  • website/docs/getting-started/options.md (2 hunks)
  • website/docs/getting-started/options/transpilation.md (3 hunks)
  • website/docs/getting-started/presets.md (25 hunks)
  • website/versioned_docs/version-29.4/getting-started/options.md (2 hunks)
  • website/versioned_docs/version-29.4/getting-started/options/transpilation.md (3 hunks)
  • website/versioned_docs/version-29.4/getting-started/presets.md (24 hunks)
💤 Files with no reviewable changes (34)
  • e2e/hoist-jest/tsconfig-cjs-transpiler.spec.json
  • examples/react-app/tsconfig-esm-isolated.spec.json
  • examples/js-with-ts/tsconfig-esm-isolated.json
  • examples/js-with-ts/tsconfig-isolated.json
  • e2e/source-map/tsconfig-esm-transpiler.spec.json
  • e2e/enum/tsconfig-esm-transpiler.spec.json
  • e2e/presets/tsconfig-esm-transpiler.spec.json
  • e2e/source-map/tsconfig-cjs-transpiler.spec.json
  • e2e/const-enum/tsconfig-esm-transpiler.spec.json
  • e2e/extend-ts-jest/tsconfig-esm-transpiler.spec.json
  • e2e/transformer-options/tsconfig-esm-transpiler.spec.json
  • e2e/esm-features/tsconfig-esm-transpiler.spec.json
  • e2e/transformer-options/tsconfig-cjs-transpiler.spec.json
  • examples/ts-only/tsconfig-esm-isolated.json
  • e2e/const-enum/tsconfig-cjs-transpiler.spec.json
  • e2e/transform-js/tsconfig-cjs-transpiler.spec.json
  • examples/js-with-babel/tsconfig-esm-isolated.json
  • e2e/transformer-in-ts/tsconfig-esm-transpiler.spec.json
  • e2e/test-utils/tsconfig-esm-transpiler.spec.json
  • e2e/transform-js/tsconfig-esm-transpiler.spec.json
  • examples/monorepo-app/type-module/tsconfig-isolated.json
  • examples/monorepo-app/type-commonjs/tsconfig-esm-isolated.json
  • examples/monorepo-app/jest-isolated.config.ts
  • examples/monorepo-app/type-module/tsconfig-esm-isolated.json
  • e2e/test-utils/tsconfig-cjs-transpiler.spec.json
  • e2e/enum/tsconfig-cjs-transpiler.spec.json
  • e2e/extend-ts-jest/tsconfig-cjs-transpiler.spec.json
  • e2e/transformer-in-ts/tsconfig-cjs-transpiler.spec.json
  • examples/js-with-babel/tsconfig-isolated.json
  • examples/monorepo-app/type-commonjs/tsconfig-isolated.json
  • examples/monorepo-app/jest-esm-isolated.config.ts
  • examples/ts-only/tsconfig-isolated.json
  • examples/react-app/tsconfig-isolated.spec.json
  • e2e/presets/tsconfig-cjs-transpiler.spec.json
🧰 Additional context used
🧬 Code graph analysis (2)
src/legacy/compiler/ts-compiler.ts (1)
src/transpilers/typescript/transpile-module.ts (1)
  • isModernNodeModuleKind (51-53)
src/legacy/compiler/ts-compiler.spec.ts (1)
src/__helpers__/fakers.ts (1)
  • makeCompiler (77-104)
🔇 Additional comments (43)
examples/react-app/jest-esm-transpiler.config.ts (1)

5-6: Approve — transpilation preset OK (tsconfig present)

examples/react-app/tsconfig-esm.spec.json exists; no further changes required.

e2e/esm-features/jest-compiler-esm.config.ts (1)

10-10: Approve — compiler-mode config points to tsconfig-esm.spec.json

Confirmed e2e/esm-features/tsconfig-esm.spec.json exists; change aligns with compiler (type-checking) mode.

examples/js-with-babel/jest-esm-transpiler.config.ts (1)

8-9: Babel ESM + ts-jest transpilation — configs verified

examples/js-with-babel/tsconfig-esm.json and a Babel config were found; leaving transpilation: true is OK.

examples/monorepo-app/type-commonjs/jest-transpiler.config.ts (1)

7-7: Set an explicit tsconfig — monorepo has multiple candidates

Found examples/monorepo-app/type-commonjs/tsconfig.json plus root tsconfig.base.json, tsconfig.build.json, tsconfig.eslint.json and tsconfig.json; ts-jest auto‑resolution can pick the wrong one. Set the tsconfig option in examples/monorepo-app/type-commonjs/jest-transpiler.config.ts to the intended file (e.g. '/examples/monorepo-app/type-commonjs/tsconfig.json' or '/tsconfig.json').

examples/monorepo-app/type-module/jest-esm-transpiler.config.ts (1)

7-8: Transpilation enabled with explicit tsconfig — LGTM
Verified examples/monorepo-app/type-module/tsconfig-esm.json exists.

examples/ts-only/jest-transpiler.config.ts (1)

7-7: LGTM: switch to transpilation mode aligns with deprecation.

No functional issues spotted.

examples/js-with-ts/jest-transpiler.config.ts (1)

7-7: LGTM; keep separate type-check in CI.

transpilation: true is appropriate here; ensure tsc --noEmit runs elsewhere.

Confirm that your CI has a job running pnpm|yarn|npm run type-check for this example.

e2e/test-utils/jest-transpiler-cjs.config.ts (1)

9-11: LGTM; path hop to shared tsconfig is sensible.

TS_TRANSFORM_PATTERN + transpilation: true is consistent for TS-only utilities.

examples/monorepo-app/jest-esm-transpiler.config.ts (1)

1-8: Aggregator config OK — child configs present. Both referenced files exist: examples/monorepo-app/type-commonjs/jest-esm-transpiler.config.ts (OK), examples/monorepo-app/type-module/jest-esm-transpiler.config.ts (OK).

examples/js-with-babel/jest-transpiler.config.ts (1)

8-8: Transpilation flag correct — ensure CI type‑check
transpilation: true confirmed in examples/js-with-babel/jest-transpiler.config.ts (line 8) and across transpiler configs; no ts-jest isolatedModules found and referenced tsconfig basenames exist. Add a CI step running tsc --noEmit (or equivalent) because transpilation disables test-time type-checking.

examples/monorepo-app/type-module/jest-transpiler.config.ts (1)

7-7: LGTM — confirm ESM-specific settings live in the ESM variant config.
Search under examples/monorepo-app/**/jest-esm-transpiler.config.ts showed no 'useESM'; ensure ESM flags (e.g., useESM) are configured in the package's jest-esm-transpiler config.

e2e/presets/jest-transpiler-cjs.config.ts (1)

9-11: Approve — tsconfig resolves to CommonJS

e2e/presets/tsconfig-cjs.spec.json extends ../tsconfig-cjs.spec.json (resolved to e2e/tsconfig-cjs.spec.json) which sets compilerOptions.module = 'CommonJS', so the tsconfig + transpilation pair is consistent.

examples/react-app/package.json (1)

9-11: Scripts rename looks good.

The new transpiler scripts align with the option rename and the example configs. No further changes needed here.

examples/monorepo-app/type-commonjs/jest-esm-transpiler.config.ts (1)

7-9: Preset switch & transpilation flag look correct — re-run search for stray tsconfig

Re-run from repo root:

rg -n --hidden --no-ignore --glob '!node_modules/**' 'tsconfig-esm-isolated\.json' || echo "No references found."
e2e/presets/jest-transpiler-esm.config.ts (1)

10-13: Verification inconclusive — ripgrep returned no output.

Cannot confirm all e2e presets include transpilation: true; re-run or verify manually:

rg -n "jest-transpiler-esm\.config\.ts" -g 'e2e/**' -l | xargs -r -I{} rg -n "transpilation:\s*true" {} || echo "Missing transpilation: true in some presets."
examples/js-with-ts/package.json (1)

7-9: Incorrect — ts-jest v29 supports Jest 30; no major alignment required
Project notes indicate ts-jest@29 supports both Jest 29 and 30, so using jest:^30 with ts-jest:^29 in the examples is acceptable; keep versions consistent across examples if desired.

Likely an incorrect or invalid review comment.

e2e/esm-features/jest-transpiler-esm.config.ts (1)

10-13: ESM transpiler config update — OK.

tsconfig-esm.spec.json + useESM: true + transpilation: true are consistent with the new option.

e2e/transformer-in-ts/jest-transpiler-esm.config.ts (1)

10-20: Transformer-in-TS under transpilation — double-check Program requirements.

This path relies on tsTranspileModule to supply a program for hoist-jest.ts. If that transformer needs full-project type info, ensure tests still pass under per-file transpilation.

src/legacy/compiler/ts-compiler.ts (1)

196-198: Behavioral change check: guard now uses runtime configSet.isolatedModules.

This decouples from tsconfig’s isolatedModules in favor of the ts‑jest option (or transpilation). Confirm this is the intended policy so users don’t silence the warning by only toggling tsconfig.

e2e/test-utils/jest-transpiler-esm.config.ts (1)

10-13: OK: switched to shared ESM tsconfig and enabled transpilation.

e2e/const-enum/jest-transpiler-cjs.config.ts (1)

9-11: Const enum transpiler config — consistent with new option.

Matches the CJS pattern used elsewhere.

e2e/transformer-in-ts/jest-transpiler-cjs.config.ts (1)

9-18: CJS transformer config under transpilation — OK; verify relative tsconfig.

Path '<rootDir>/../tsconfig-cjs.spec.json' assumes the shared tsconfig lives one level up from this config. Confirm presence (script in first comment checks this).

jest.config.ts (1)

20-21: Root tests now run with transpilation: true — ensure a non‑transpiled test config remains

File: jest.config.ts (lines 20–21) — root tests enable transpilation: true; keep at least one config without transpilation so language‑service/type‑checking paths are exercised. Quick verification script returned no matches in the sandbox; run the included scan locally and attach its output to confirm.

e2e/enum/jest-transpiler-cjs.config.ts (1)

9-10: Adopt transpilation: true and tsconfig path change — approved.

Verified: all referenced tsconfig paths exist (20 references).

e2e/enum/jest-transpiler-esm.config.ts (1)

10-13: Config update LGTM.

Switching to tsconfig-esm.spec.json and adding transpilation: true matches the new option.

e2e/transform-js/jest-transpiler-esm.config.ts (1)

10-13: ESM transpiler config looks correct.

tsconfig path + transpilation: true are consistent with the migration.

e2e/transformer-options/jest-transpiler-esm.config.ts (1)

11-24: Transpilation + AST transformer: confirm compatibility.

This keeps the FormatJS transformer while enabling transpilation mode; tests likely cover it. Flagging for a quick sanity run if not already exercised by CI.

e2e/transformer-options/jest-transpiler-cjs.config.ts (1)

10-22: CJS config update LGTM.

Normalized tsconfig and added transpilation: true. No issues spotted.

e2e/source-map/jest-transpiler-esm.config.ts (1)

10-13: Relative tsconfig path change — verify location.

Path moved to '/../tsconfig-esm.spec.json'. Assuming centralization, this is fine; please confirm the file exists at that level.

e2e/transform-js/jest-transpiler-cjs.config.ts (1)

9-11: CJS transpiler config LGTM.

tsconfig update + transpilation: true align with the new option.

e2e/hoist-jest/jest-transpiler-cjs.config.ts (1)

9-11: Hoist-jest config LGTM.

Consistent with other CJS transpiler configs.

src/types.ts (1)

63-97: Sanity check: public surface area compatibility — verified.

transpilation?: boolean is present on TsJestGlobalOptions/TsJestTransformerOptions (src/types.ts) and the config layer preserves backward compatibility via this.isolatedModules = options.isolatedModules ?? options.transpilation ?? false (src/legacy/config/config-set.ts:219); e2e examples and website docs already use transpilation — no compatibility issues found.

examples/monorepo-app/jest-transpiler.config.ts (1)

3-5: Monorepo aggregator config LGTM.

projects targets the two sub-configs and the object is constrained with satisfies Config. Looks correct.

e2e/extend-ts-jest/jest-transpiler-cjs.config.ts (1)

9-11: CJS transpiler config update LGTM.

transpilation: true and move to tsconfig-cjs.spec.json align with the new option. No issues spotted.

e2e/extend-ts-jest/jest-transpiler-esm.config.ts (1)

10-13: Transpilation switch looks good; add '.mts' to ESM extensions if needed.

  • Switch to tsconfig-esm.spec.json with transpilation: true — LGTM.
  • I searched e2e/extend-ts-jest for '.mts' (rg -n '.mts\b') and found no matches; if this suite contains any .mts files, add '.mts' to extensionsToTreatAsEsm in e2e/extend-ts-jest/jest-transpiler-esm.config.ts.
e2e/source-map/jest-transpiler-cjs.config.ts (1)

9-11: Confirmed: shared tsconfig exists.
Path /../tsconfig-cjs.spec.json resolves to e2e/tsconfig-cjs.spec.json — file present.

e2e/const-enum/jest-transpiler-esm.config.ts (1)

10-13: Preserve const enum behavior verified — no action required.

No tsconfig in the extends chain sets "preserveConstEnums" (e2e/const-enum/tsconfig-esm.spec.json -> e2e/tsconfig-js.json and e2e/tsconfig-esm.spec.json, both extending tsconfig.base.json); the only repository match for that key is the type declaration in src/raw-compiler-options.ts. preserveConstEnums defaults to false, so const enums will be inlined with transpilation: true.

src/legacy/config/config-set.spec.ts (1)

14-14: Import cleanup — LGTM

Switching to { Deprecations, Errors } (dropping interpolate) fits the new messaging usage.

src/utils/messages.ts (1)

48-50: Deprecation text — LGTM

Clear, version-tagged, and linked to the new docs.

website/docs/getting-started/presets.md (1)

33-35: Preset option docs updated — LGTM

Adding transpilation to parameters and typings looks consistent across sections.

Also applies to: 48-59

website/versioned_docs/version-29.4/getting-started/options.md (1)

44-44: Versioned docs updated — LGTM

transpilation.md present at website/versioned_docs/version-29.4/getting-started/options/transpilation.md; row and reference match non-versioned docs.

examples/monorepo-app/package.json (1)

12-12: Script rename aligns with option rename — LGTM

Verified jest-transpiler.config.ts exists at examples/monorepo-app/{jest-transpiler.config.ts, type-commonjs/jest-transpiler.config.ts, type-module/jest-transpiler.config.ts}; no jest-isolated.config.ts files found.

Also applies to: 15-15

website/docs/getting-started/options.md (1)

44-44: Docs reflect rename to transpilation — files present; confirm site build

Found:

  • website/docs/getting-started/options/transpilation.md
  • website/versioned_docs/version-29.4/getting-started/options/transpilation.md

LGTM; verify the docs build locally and links render.

@ahnpnl ahnpnl merged commit 5868761 into main Sep 17, 2025
22 checks passed
@ahnpnl ahnpnl deleted the fix/isolated-modules branch September 17, 2025 11:38
ahnpnl added a commit that referenced this pull request Sep 18, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 18, 2025
2 tasks
ahnpnl added a commit that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hybrid module warning cluttering tests output [Bug]: no type check when tsconfig's isolatedModules compiler option is true

3 participants