import { BaseRuleVisitor } from "./rule-utils.js";
class ERBNoEmptyTagsVisitor extends BaseRuleVisitor {
    visitERBContentNode(node) {
        this.visitChildNodes(node);
        const { content, tag_closing } = node;
        if (!content)
            return;
        if (tag_closing?.value === "")
            return;
        if (content.value.trim().length > 0)
            return;
        this.addOffense("ERB tag should not be empty. Remove empty ERB tags or add content.", node.location, "error");
    }
}
export class ERBNoEmptyTagsRule {
    name = "erb-no-empty-tags";
    check(node) {
        const visitor = new ERBNoEmptyTagsVisitor(this.name);
        visitor.visit(node);
        return visitor.offenses;
    }
}
//# sourceMappingURL=erb-no-empty-tags.js.map