diff --git a/.changeset/smooth-dolls-cry.md b/.changeset/smooth-dolls-cry.md new file mode 100644 index 0000000..2acaa4d --- /dev/null +++ b/.changeset/smooth-dolls-cry.md @@ -0,0 +1,5 @@ +--- +'esrap': patch +--- + +fix: loosen types for `getLeadingComments` and `getTrailingComments` diff --git a/src/languages/types.d.ts b/src/languages/types.d.ts index 7e60a07..20d2d76 100644 --- a/src/languages/types.d.ts +++ b/src/languages/types.d.ts @@ -1,10 +1,11 @@ import { TSESTree } from '@typescript-eslint/types'; +import { BaseNode } from '../types'; export type TSOptions = { quotes?: 'double' | 'single'; comments?: Comment[]; - getLeadingComments?: (node: TSESTree.Node) => BaseComment[] | undefined; - getTrailingComments?: (node: TSESTree.Node) => BaseComment[] | undefined; + getLeadingComments?: (node: BaseNode) => BaseComment[] | undefined; + getTrailingComments?: (node: BaseNode) => BaseComment[] | undefined; }; interface Position {