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

imported module evaluated as non-strict if importing module is not explicitly a module #676

Open
4 of 6 tasks
mhofman opened this issue Nov 18, 2024 · 1 comment
Open
4 of 6 tasks
Labels
bug Something isn't working pending triage

Comments

@mhofman
Copy link

mhofman commented Nov 18, 2024

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://stackblitz.com/edit/node-3q8xbs?file=index.ts

Problem & expected behavior (under 200 words)

An es modules imported by a tsx transformed file will be evaluated in sloppy/strict mode depending on the module type of the importing file, which should have no effect. A file parsed and evaluated as esm should always be strict.

When running tsx index.ts, we get isStrict: false which is incorrect. tsx index.mts or node index.mjs both output isStrict: true as expected.

For some reason a dynamic import does not exhibit the same problem.

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support
@mhofman mhofman added bug Something isn't working pending triage labels Nov 18, 2024
@mhofman
Copy link
Author

mhofman commented Nov 18, 2024

Possibly related to #442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage
Projects
None yet
Development

No branches or pull requests

1 participant