MCPcopy
hub / github.com/prettier/prettier / hasLeadingBlockCommentWithName

Function hasLeadingBlockCommentWithName

src/language-js/embed/utilities.js:64–75  ·  view source on GitHub ↗
(node, languageName)

Source from the content-addressed store, hash-verified

62}
63
64function hasLeadingBlockCommentWithName(node, languageName) {
65 // This checks for a leading comment that is exactly `/* GraphQL */`
66 // In order to be in line with other implementations of this comment tag
67 // we will not trim the comment value and we will expect exactly one space on
68 // either side of the GraphQL string
69 // Also see ./clean.js
70 return hasComment(
71 node,
72 CommentCheckFlags.Block | CommentCheckFlags.Leading,
73 ({ value }) => value === ` ${languageName} `,
74 );
75}
76function hasLanguageComment({ node, parent }, languageName) {
77 return (
78 hasLeadingBlockCommentWithName(node, languageName) ||

Callers 1

hasLanguageCommentFunction · 0.85

Calls 1

hasCommentFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…