import { AttributeVisitorMixin, getAttributeValueQuoteType, hasAttributeValue } from "./rule-utils.js";
class AttributeDoubleQuotesVisitor extends AttributeVisitorMixin {
    checkAttribute(attributeName, attributeValue, attributeNode) {
        if (!hasAttributeValue(attributeNode))
            return;
        if (getAttributeValueQuoteType(attributeNode) !== "single")
            return;
        if (attributeValue?.includes('"'))
            return; // Single quotes acceptable when value contains double quotes
        this.addOffense(`Attribute \`${attributeName}\` uses single quotes. Prefer double quotes for HTML attribute values: \`${attributeName}="value"\`.`, attributeNode.value.location, "warning");
    }
}
export class HTMLAttributeDoubleQuotesRule {
    name = "html-attribute-double-quotes";
    check(node) {
        const visitor = new AttributeDoubleQuotesVisitor(this.name);
        visitor.visit(node);
        return visitor.offenses;
    }
}
//# sourceMappingURL=html-attribute-double-quotes.js.map