UNPKG

eslint-codemod-utils

Version:

A collection of AST helper functions for more complex ESLint rule fixes.

16 lines (15 loc) 329 B
/** * @example * ```tsx * // this is the search comment * const findThisNode = 10 * ^^^^^^^^^^^^^^^^^^^^^^^ * ``` */ export function getNodeAfterComment(source, comment) { const token = source.getTokenAfter(comment); if (token) { return source.getNodeByRangeIndex(token.range[1]); } return null; }