Skip to content

Commit 9364968

Browse files
committed
updating hasPrettierIgnore type
1 parent e205c6d commit 9364968

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/slang-utils/has-prettier-ignore.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { isBlockComment, isComment } from './is-comment.js';
22

33
import type { AstPath } from 'prettier';
4-
import type { AstNode } from '../slang-nodes/types.js';
4+
import type { PrintableNode } from '../slang-nodes/types.js';
55

6-
export function hasPrettierIgnore({ node }: AstPath<AstNode>): boolean {
7-
if (typeof node === 'string' || node === undefined || isComment(node))
8-
return false;
6+
export function hasPrettierIgnore({
7+
node
8+
}: AstPath<PrintableNode | undefined>): boolean {
9+
if (node === undefined || isComment(node)) return false;
910

1011
// Prettier sets SourceUnit's comments to undefined after assigning comments
1112
// to each node.

0 commit comments

Comments
 (0)