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 4e9cdc4 commit 62bf068Copy full SHA for 62bf068
1 file changed
src/printer.js
@@ -49,18 +49,22 @@ 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
- if (
- node &&
- node.comments &&
- node.comments.length > 0 &&
- node.comments.some(comment => comment.value.trim() === "prettier-ignore")
- ) {
67
+ if (hasPrettierIgnoreComment(node)) {
68
return options.originalText.slice(util.locStart(node), util.locEnd(node));
69
70
0 commit comments