Pass options to willPrintOwnComments() (#6081)
parent
d805083a07
commit
64ab703d41
|
@ -6478,7 +6478,7 @@ function isTheOnlyJSXElementInMarkdown(options, path) {
|
|||
return parent.type === "Program" && parent.body.length == 1;
|
||||
}
|
||||
|
||||
function willPrintOwnComments(path) {
|
||||
function willPrintOwnComments(path /*, options */) {
|
||||
const node = path.getValue();
|
||||
const parent = path.getParentNode();
|
||||
|
||||
|
|
|
@ -53,7 +53,10 @@ function printAstToDoc(ast, options, alignmentSize = 0) {
|
|||
// We let JSXElement print its comments itself because it adds () around
|
||||
// UnionTypeAnnotation has to align the child without the comments
|
||||
let res;
|
||||
if (printer.willPrintOwnComments && printer.willPrintOwnComments(path)) {
|
||||
if (
|
||||
printer.willPrintOwnComments &&
|
||||
printer.willPrintOwnComments(path, options)
|
||||
) {
|
||||
res = callPluginPrintFunction(path, options, printGenerically, args);
|
||||
} else {
|
||||
// printComments will call the plugin print function and check for
|
||||
|
|
Loading…
Reference in New Issue