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
Respect preserveComments option in tempate.ast() #11112
Respect preserveComments option in tempate.ast() #11112
Conversation
@@ -219,7 +231,7 @@ describe("@babel/template", function() { | |||
}); | |||
}); | |||
|
|||
describe.only(".syntacticPlaceholders", () => { | |||
describe(".syntacticPlaceholders", () => { |
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.
😬
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.
We should probably lint for this 😬
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.
Actually, it looks like we should be linting for this already: https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-focused-tests.md is a recommended rule. 🤔
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.
We added it yesterday 😛
#11119
Thanks! |
validate(opts)
addedpreserveComments: false
whenpreserveComments
was not present in the validated options. This caused theNO_PLACEHOLDER
options inbuilder.js
to containpreserveComments: false
. So sinceNO_PLACEHOLDER
later is merged in to the rest of the options given to template.ast() the preserveComments option was always set to false.This PR changes
validate(opts)
so it keepspreserveComments
undefined if it was null/undefined.