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
Always use sourceFileName
instead of sourceFilename
.
#10291
Conversation
There seems to be some confusion around which of these two is correct within the codebase. This consolidates all instances to be `sourceFileName` since that one had more instances.
Co-Authored-By: Henry Zhu <hi@henryzoo.com>
@@ -26,7 +26,7 @@ export default class Parser extends StatementParser { | |||
this.inModule = this.options.sourceType === "module"; | |||
this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); | |||
this.plugins = pluginsMap(this.options.plugins); | |||
this.filename = options.sourceFilename; | |||
this.filename = options.sourceFilename || options.sourceFileName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the nullish coaleshing proposal is now stage 3, we could enable @babel/plugin-proposal-nullish-coalescing-operator
and use options.sourceFilename ?? options.sourceFileName
😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been enabled on master, you just need to rebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR.
I believe the documentation on the website already uses sourceFileName
.
I'm not sure what should be done about the test failures. Anyone else want to advise? |
I'm not sure, maybe try rebasing it 🤔 |
@@ -1,5 +1,5 @@ | |||
type BabelParserOptions = { | |||
sourceFilename?: string; | |||
sourceFileName?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this a breaking change?
Not sure what should be done to make this work, so I'm just going to close it. If someone else wants to pick it up, feel free. |
There seems to be some confusion around which of these two is correct within the codebase. This consolidates all instances to be
sourceFileName
since that one had more instances.