We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1a61eb commit 1e60895Copy full SHA for 1e60895
1 file changed
src/printer.js
@@ -49,22 +49,18 @@ function shouldPrintComma(options, level) {
49
}
50
51
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
-
61
function genericPrint(path, options, printPath, args) {
62
assert.ok(path instanceof FastPath);
63
64
var node = path.getValue();
65
66
// Escape hatch
67
- if (hasPrettierIgnoreComment(node)) {
+ if (
+ node &&
+ node.comments &&
+ node.comments.length > 0 &&
+ node.comments.some(comment => comment.value.trim() === "prettier-ignore")
+ ) {
68
return options.originalText.slice(util.locStart(node), util.locEnd(node));
69
70
0 commit comments