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]: sourceFileName
vs. sourceFilename
scattered differently over project, sometimes typed wrong
#13170
Comments
Hey @wooorm! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
That's because different packages are now using different option name. We may align the syntax in Babel 8 because it is a breaking change. I would prefer to replace |
I can understand differently cases due to history, and would welcome a single case. But it remains that the types are incorrect, and fixing that doesn’t have to be a major |
We can start by allowing both the current "mixed" versions and the consistent versions in the next minor; then in Babel 8 we can remove the "mixed" versions (and yes, we should fix the type definitions). |
I did some research while changing all occurrences of babel/packages/babel-core/src/transformation/normalize-opts.ts Lines 29 to 33 in 90d5eb7
We are setting the unused sourceFileName parser option and, in fact, commenting line 33 results in no tests failing, because there is "nothing to break".
|
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
n/a
Configuration file name
No response
Configuration
n/a
Current and expected behavior
^-- type error “Did you mean 'sourceFilename'”, but
sourceFilename
is undefined andsourceFileName
is set.A bit of searching shows differently cased values: https://github.com/babel/babel/search?q=sourceFilename+path%3Apackages.
Environment
Possible solution
picking either
Additional context
Actual code is here: https://github.com/wooorm/xdm/blob/main/test/babel.js#L37-L41.
The text was updated successfully, but these errors were encountered: