eslint-plugin-comment-length
Version:
An ESLint plugin that provides rules that limit the line length of your comments
22 lines (19 loc) • 685 B
text/typescript
import { TSESTree } from "@typescript-eslint/utils";
export function isSemanticComment(
comment: TSESTree.BlockComment | TSESTree.LineComment,
semanticComments?: string[],
): boolean {
const includesCustomSemanticComment =
semanticComments?.some((semanticComment) =>
comment.value.includes(semanticComment),
) || false;
return (
comment.value.includes("eslint-disable") ||
comment.value.includes("stylelint-disable") ||
comment.value.includes("tslint:disable") ||
comment.value.includes("eslint-enable") ||
comment.value.includes("stylelint-enable") ||
comment.value.includes("tslint:enable") ||
includesCustomSemanticComment
);
}