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

feat: allow passing generatorOpts down to Babel #323

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

olaf-k
Copy link

@olaf-k olaf-k commented Jan 1, 2025

hey! I recently had an issue with my instrumented code failing tests and found out that Babel was transforming our json imports incorrectly. I thought I'd open a PR to add

generatorOpts: {
  importAttributesKeyword: 'with'
}

to the createInstrumenter options, but ended up with this one which is more generic. WDYT?

(happy new year!)

@iFaxity
Copy link
Owner

iFaxity commented Jan 7, 2025

Hi @olaf-k, thanks for contributing.

Absolutely, LGTM.

@iFaxity
Copy link
Owner

iFaxity commented Jan 7, 2025

If you could add the correct typing to generatorOpts from babel it would be great. Leaving it loosely typed is not ideal.

Import GeneratorOptions from @babel/core and use it to type the generatorOpts in the ParserOptions.

See: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/babel__core/index.d.ts

@olaf-k
Copy link
Author

olaf-k commented Jan 7, 2025

If you could add the correct typing to generatorOpts from babel it would be great. Leaving it loosely typed is not ideal.

sure thing, I updated the PR, LMK if that's what you had in mind?

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.

2 participants