Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/oxlint/src-js/plugins/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
1 change: 1 addition & 0 deletions apps/oxlint/src-js/plugins/source_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading