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

fix: generate modules for empty files with esModuleInterop #992

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

jk-apple
Copy link
Contributor

Fixes #908.

it("generate as external module", () => {
const generatedPath = path.join(__dirname, "extension.ts");
const generatedCode = fs.readFileSync(generatedPath, "utf8");
const source = ts.createSourceFile(generatedPath, generatedCode, ts.ScriptTarget.ES2018);
Copy link
Owner

Choose a reason for hiding this comment

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

I appreciate the test @jk-apple , but I think in this case our "lazy" approach of just checking in the extension.ts file will serve as a good-enough regression + probably resolve the CI error that's failing to find the file to assert against.

If you could push that up, that'd be great; appreciate the fix!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the help, pushed it.

@stephenh
Copy link
Owner

Looks great, thanks!

@stephenh stephenh merged commit f0629ab into stephenh:main Jan 26, 2024
6 checks passed
stephenh pushed a commit that referenced this pull request Jan 26, 2024
## [1.167.1](v1.167.0...v1.167.1) (2024-01-26)

### Bug Fixes

* generate modules for empty files with esModuleInterop ([#992](#992)) ([f0629ab](f0629ab))
@stephenh
Copy link
Owner

🎉 This PR is included in version 1.167.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error TS2306 (not a module) for empty files
2 participants