Skip to content

Commit 1e60895

Browse files
committed
Revert "printer: Extract hasPrettierIgnoreComment() helper"
See #1609 (comment) This reverts commit 62bf068.
1 parent c1a61eb commit 1e60895

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/printer.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,18 @@ function shouldPrintComma(options, level) {
4949
}
5050
}
5151

52-
function hasPrettierIgnoreComment(node) {
53-
return (
54-
node &&
55-
node.comments &&
56-
node.comments.length > 0 &&
57-
node.comments.some(comment => comment.value.trim() === "prettier-ignore")
58-
);
59-
}
60-
6152
function genericPrint(path, options, printPath, args) {
6253
assert.ok(path instanceof FastPath);
6354

6455
var node = path.getValue();
6556

6657
// Escape hatch
67-
if (hasPrettierIgnoreComment(node)) {
58+
if (
59+
node &&
60+
node.comments &&
61+
node.comments.length > 0 &&
62+
node.comments.some(comment => comment.value.trim() === "prettier-ignore")
63+
) {
6864
return options.originalText.slice(util.locStart(node), util.locEnd(node));
6965
}
7066

0 commit comments

Comments
 (0)