diff --git a/apps/oxlint/src-js/plugins/comments.ts b/apps/oxlint/src-js/plugins/comments.ts index 610a696943543..f902208d87e9a 100644 --- a/apps/oxlint/src-js/plugins/comments.ts +++ b/apps/oxlint/src-js/plugins/comments.ts @@ -200,3 +200,17 @@ export function commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: No comments[firstCommentBetween].end <= nodeOrToken2.range[0] ); } + +/** + * Retrieve the JSDoc comment for a given node. + * + * @deprecated + * + * @param node - The AST node to get the comment for. + * @returns The JSDoc comment for the given node, or `null` if not found. + */ +/* oxlint-disable no-unused-vars */ +export function getJSDocComment(node: Node): Comment | null { + throw new Error('`sourceCode.getJSDocComment` is not supported at present (and deprecated)'); // TODO +} +/* oxlint-enable no-unused-vars */ diff --git a/apps/oxlint/src-js/plugins/source_code.ts b/apps/oxlint/src-js/plugins/source_code.ts index ff17c5e6e6c57..dc90219f75e47 100644 --- a/apps/oxlint/src-js/plugins/source_code.ts +++ b/apps/oxlint/src-js/plugins/source_code.ts @@ -212,6 +212,7 @@ export const SOURCE_CODE = Object.freeze({ getCommentsAfter: commentMethods.getCommentsAfter, getCommentsInside: commentMethods.getCommentsInside, commentsExistBetween: commentMethods.commentsExistBetween, + getJSDocComment: commentMethods.getJSDocComment, // Scope methods isGlobalReference: scopeMethods.isGlobalReference,