MCPcopy
hub / github.com/prettier/prettier / printIgnored

Function printIgnored

src/language-js/print/ignored.js:10–25  ·  view source on GitHub ↗
(path, options /* , print*/)

Source from the content-addressed store, hash-verified

8import { shouldExpressionStatementPrintLeadingSemicolon } from "../semicolon/semicolon.js";
9
10function printIgnored(path, options /* , print*/) {
11 const { node } = path;
12 let text = options.originalText.slice(locStart(node), locEnd(node));
13
14 if (options.semi && shouldIgnoredNodePrintSemicolon(node)) {
15 text += ";";
16 } else if (shouldExpressionStatementPrintLeadingSemicolon(path, options)) {
17 text = `;${text}`;
18 }
19
20 if (node.type === "ClassExpression" && isNonEmptyArray(node.decorators)) {
21 return [indent([softline, text]), softline];
22 }
23
24 return text;
25}
26
27export { printIgnored };

Callers 1

printFunction · 0.90

Calls 6

locStartFunction · 0.90
locEndFunction · 0.90
indentFunction · 0.90
isNonEmptyArrayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…