eslint-plugin-comment-length
Version:
An ESLint plugin that provides rules that limit the line length of your comments
9 lines (7 loc) • 364 B
JavaScript
function isCommentOnOwnLine(sourceCode, comment) {
const previousToken = sourceCode.getTokenBefore(comment);
const nextToken = sourceCode.getTokenAfter(comment);
return previousToken?.loc.end.line !== comment.loc?.start.line && nextToken?.loc.start.line !== comment.loc?.end.line;
}
export { isCommentOnOwnLine };
//# sourceMappingURL=is-on-own-line.js.map