UNPKG

eslint-plugin-comment-length

Version:

An ESLint plugin that provides rules that limit the line length of your comments

27 lines (24 loc) 758 B
import { formatBlock } from './util.format-block.js'; function canBlockBeCompated(block, context) { if (!block.value.trim()) { return false; } const formattedBlock = formatBlock(block, context).trim(); const formattedLines = formattedBlock.split("\n"); if (formattedLines.length !== block.lines.length) { return true; } for (let i = 0; i < formattedLines.length; i++) { const formattedLine = formattedLines[i]?.replace(/^ *\*/, "").trim(); const originalLine = block.lines[i]?.trim(); if (!formattedLine || !originalLine) { continue; } if (formattedLine !== originalLine) { return true; } } return false; } export { canBlockBeCompated }; //# sourceMappingURL=util.can-block-be-compacted.js.map