Skip to content

refactor: deprecate transform option isolatedModules #4709

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

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

ahnpnl
Copy link
Collaborator

@ahnpnl ahnpnl commented Mar 6, 2025

Summary

Deprecate in favor of TypeScript isolatedModules

Test plan

Green CI

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

N.A.

@ahnpnl ahnpnl force-pushed the refactor/depreate-isolated-modules branch from 3666ed2 to 9510777 Compare March 6, 2025 22:36
@ahnpnl ahnpnl requested a review from Copilot March 6, 2025 22:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This pull request refactors the code by deprecating the transform option "isolatedModules" in favor of using TypeScript’s native isolatedModules support. In addition, it updates various Jest configuration files to reference new tsconfig filenames and replaces the legacy commitlint.config.js file with a TypeScript version.

  • Removed "isolatedModules" options from Jest transformer configurations
  • Updated tsconfig file paths to use the new "-transpiler" variants
  • Replaced commitlint.config.js with commitlint.config.ts for improved type safety

Reviewed Changes

File Description
commitlint.config.ts Introduces a TypeScript commitlint configuration with type annotations
e2e/enum/jest-transpiler-cjs.config.ts Updates tsconfig path and removes unsupported isolatedModules option
e2e/presets/jest-transpiler-cjs.config.ts Updates tsconfig path and removes unsupported isolatedModules option
e2e/const-enum/jest-transpiler-cjs.config.ts Updates tsconfig path and removes unsupported isolatedModules option
e2e/hoist-jest/jest-transpiler-cjs.config.ts Updates tsconfig path and removes unsupported isolatedModules option
e2e/enum/jest-transpiler-esm.config.ts Updates tsconfig path and removes unsupported isolatedModules option (with useESM)
e2e/const-enum/jest-transpiler-esm.config.ts Updates tsconfig path and removes unsupported isolatedModules option (with useESM)
e2e/extend-ts-jest/jest-transpiler-esm.config.ts Updates tsconfig path and removes unsupported isolatedModules option (with useESM)
e2e/esm-features/jest-transpiler-esm.config.ts Updates tsconfig path and removes unsupported isolatedModules option (with useESM)
e2e/extend-ts-jest/jest-transpiler-cjs.config.ts Updates tsconfig path and removes unsupported isolatedModules option
e2e/esm-features/jest-compiler-esm.config.ts Updates tsconfig path and removes unsupported isolatedModules option (with useESM)
commitlint.config.js Deleted in favor of the new commitlint.config.ts

Copilot reviewed 81 out of 81 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (11)

e2e/enum/jest-transpiler-cjs.config.ts:8

  • The 'isolatedModules: true' option has been removed; please ensure that '/tsconfig-cjs-transpiler.spec.json' includes all necessary settings to correctly handle module isolation.
 -        isolatedModules: true,

e2e/presets/jest-transpiler-cjs.config.ts:8

  • After removing 'isolatedModules: true', verify that '/tsconfig-cjs-transpiler.spec.json' is properly configured to replace its functionality.
 -        isolatedModules: true,

e2e/const-enum/jest-transpiler-cjs.config.ts:8

  • Ensure that the new tsconfig file '/tsconfig-cjs-transpiler.spec.json' compensates for the removed 'isolatedModules' option in this configuration.
 -        isolatedModules: true,

e2e/hoist-jest/jest-transpiler-cjs.config.ts:8

  • Verify that '/tsconfig-cjs-transpiler.spec.json' is correctly set up given that the 'isolatedModules' flag has been removed.
 -        isolatedModules: true,

e2e/enum/jest-transpiler-esm.config.ts:8

  • Since 'isolatedModules' has been removed, confirm that '/tsconfig-esm-transpiler.spec.json' properly handles module isolation along with the useESM setting.
 -        isolatedModules: true,

e2e/const-enum/jest-transpiler-esm.config.ts:8

  • After removing the deprecated option, ensure that '/tsconfig-esm-transpiler.spec.json' is configured to deliver the same module processing behavior.
 -        isolatedModules: true,

e2e/extend-ts-jest/jest-transpiler-esm.config.ts:8

  • Make sure that the new tsconfig '/tsconfig-esm-transpiler.spec.json' covers the configuration previously provided by the removed isolatedModules flag.
 -        isolatedModules: true,

e2e/esm-features/jest-transpiler-esm.config.ts:8

  • Confirm that '/tsconfig-esm-transpiler.spec.json' is properly set up to replace 'isolatedModules: true' since the option has been removed.
 -        isolatedModules: true,

e2e/extend-ts-jest/jest-transpiler-cjs.config.ts:8

  • Review the new tsconfig file '/tsconfig-cjs-transpiler.spec.json' to ensure that it covers any behaviors previously enabled by 'isolatedModules: true'.
 -        isolatedModules: true,

e2e/esm-features/jest-compiler-esm.config.ts:8

  • Since the tsconfig has been updated to '/tsconfig-esm-transpiler.spec.json', verify that all necessary compiler options are properly defined in the new configuration, given the removal of the 'isolatedModules' flag.
 -        tsconfig: '<rootDir>/tsconfig-esm.spec.json',

commitlint.config.js:1

  • The legacy commitlint.config.js file has been removed in favor of commitlint.config.ts; please ensure that build scripts and tooling references are updated accordingly.
 -module.exports = {

@coveralls
Copy link

coveralls commented Mar 6, 2025

Pull Request Test Coverage Report for Build 13709738379

Details

  • 35 of 35 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 95.29%

Totals Coverage Status
Change from base Build 13675534799: 0.02%
Covered Lines: 4788
Relevant Lines: 4966

💛 - Coveralls

@ahnpnl ahnpnl force-pushed the refactor/depreate-isolated-modules branch from 9510777 to 0abc0f3 Compare March 6, 2025 22:49
@ahnpnl ahnpnl marked this pull request as ready for review March 6, 2025 22:53
@ahnpnl ahnpnl requested a review from kulshekhar as a code owner March 6, 2025 22:53
@ahnpnl ahnpnl merged commit 7dfef71 into main Mar 7, 2025
17 checks passed
@ahnpnl ahnpnl deleted the refactor/depreate-isolated-modules branch March 7, 2025 05:01
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]: isolatedModules property in ts-jest config doesn't create isolatedModule option in normalized tsconfig [Feature]: rename isolatedModules
3 participants