Pass options to willPrintOwnComments() (#6081)

master
Julian Rosse 2019-06-04 11:48:51 -04:00 committed by Lucas Duailibe
parent d805083a07
commit 64ab703d41
2 changed files with 5 additions and 2 deletions

View File

@ -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();

View File

@ -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