We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
hasPrettierIgnore
1 parent e205c6d commit 9364968Copy full SHA for 9364968
1 file changed
src/slang-utils/has-prettier-ignore.ts
@@ -1,11 +1,12 @@
1
import { isBlockComment, isComment } from './is-comment.js';
2
3
import type { AstPath } from 'prettier';
4
-import type { AstNode } from '../slang-nodes/types.js';
+import type { PrintableNode } from '../slang-nodes/types.js';
5
6
-export function hasPrettierIgnore({ node }: AstPath<AstNode>): boolean {
7
- if (typeof node === 'string' || node === undefined || isComment(node))
8
- return false;
+export function hasPrettierIgnore({
+ node
+}: AstPath<PrintableNode | undefined>): boolean {
9
+ if (node === undefined || isComment(node)) return false;
10
11
// Prettier sets SourceUnit's comments to undefined after assigning comments
12
// to each node.
0 commit comments