-
Notifications
You must be signed in to change notification settings - Fork 466
fix: deprecate isolatedModules by using new option transpilation
#5044
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
Conversation
WalkthroughReplaces 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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
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.
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. Comment |
70f9acb to
34a3bee
Compare
|
…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
34a3bee to
f76b332
Compare
|
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.
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 wordingThis 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 canOptional: 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 = falsesrc/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
createDefaultLegacyPresetin 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 totranspilation; 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 runningtsc --noEmitin 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 mockReturnValueOnceIf 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 typoThis 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
📒 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.jsonConfirmed 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 verifiedexamples/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 candidatesFound 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: trueis appropriate here; ensuretsc --noEmitruns elsewhere.Confirm that your CI has a job running
pnpm|yarn|npm run type-checkfor 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: trueis 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 CommonJSe2e/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 tsconfigRe-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: trueare 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
tsTranspileModuleto supply aprogramforhoist-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 runtimeconfigSet.isolatedModules.This decouples from tsconfig’s
isolatedModulesin favor of the ts‑jest option (ortranspilation). 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 withtranspilation: true— ensure a non‑transpiled test config remainsFile: 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: Adopttranspilation: trueand 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.
projectstargets the two sub-configs and the object is constrained withsatisfies Config. Looks correct.e2e/extend-ts-jest/jest-transpiler-cjs.config.ts (1)
9-11: CJS transpiler config update LGTM.
transpilation: trueand move totsconfig-cjs.spec.jsonalign 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 — LGTMSwitching to { Deprecations, Errors } (dropping interpolate) fits the new messaging usage.
src/utils/messages.ts (1)
48-50: Deprecation text — LGTMClear, version-tagged, and linked to the new docs.
website/docs/getting-started/presets.md (1)
33-35: Preset option docs updated — LGTMAdding 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 — LGTMtranspilation.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 — LGTMVerified 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 totranspilation— files present; confirm site buildFound:
- 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.

Summary
When
isolatedModulesoption was introduced, the purpose was to indicate that it is a way to enable "transpilation mode", which is similar to other tools likeBabel,swc,esbuildare doing.However, this created a big misunderstanding and confusion between
isolatedModulesoption intsconfigvsts-jestoption. Therefore,ts-jestrenamedisolatedModulesoption totranspilationto make things clearerCloses #5013
Closes #4859
Test plan
Green CI
Does this PR introduce a breaking change?
Other information
N.A.
Summary by CodeRabbit
New Features
Documentation
Chores