Skip to content
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

[Bug]: Should Not Show Warning About esModuleInterop If module is node16 or nodenext #4266

Open
threeal opened this issue Feb 13, 2024 · 0 comments

Comments

@threeal
Copy link

threeal commented Feb 13, 2024

Version

29.1.2

Steps to reproduce

Modify the tsconfig.json file by setting module to node16 or nodenext and don't specify the esModuleInterop option. As of me, i'm using the following configuration:

{
  "include": ["src"],
  "exclude": ["**/*.test.*"],
  "compilerOptions": {
    "exactOptionalPropertyTypes": true,
    "strict": true,
    "module": "node16",
    "declaration": true,
    "outDir": "dist",
    "target": "es2022",
    "skipLibCheck": true
  }
}

Expected behavior

Should not show warning about a suggestion to set the esModuleInterop to true. As seen here, the esModuleInterop option defaults to true if module is node16 or nodenext, so not specifying esModuleInterop on node16 should behave the same as setting esModuleInterop to true.

Actual behavior

Got this warning, everything works fine though:

ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting `esModuleInterop` to `true` in your TypeScript configuration file (usually `tsconfig.json`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.

Debug log

...

Additional context

No response

Environment

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12600
  Binaries:
    Node: 21.6.0 - ~/.nvm/versions/node/v21.6.0/bin/node
    Yarn: 4.1.0 - /mnt/c/Program Files/nodejs/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v21.6.0/bin/npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant