How to use the @hint/utils-compat-data.getUnsupportedDetails function in @hint/utils-compat-data

To help you get started, we’ve selected a few @hint/utils-compat-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webhintio / hint / packages / hint-compat-api / src / css.ts View on Github external
const validateDeclValue = (node: Declaration, context: Context): ReportData | null => {
    const unsupported = getUnsupportedDetails({ property: node.prop, value: node.value }, context.browsers);

    if (unsupported) {
        const formatFeature = (value: string) => {
            return `${node.prop}: ${value}`;
        };

        return { feature: formatFeature(node.value), formatFeature, isValue: true, node, unsupported };
    }

    return null;
};
github webhintio / hint / packages / hint-compat-api / src / html.ts View on Github external
const validateElement = (node: HTMLElement, context: Context) => {
    const element = node.nodeName.toLowerCase();

    if (context.ignore.has(element)) {
        return;
    }

    const unsupported = getUnsupportedDetails({ element }, context.browsers);

    if (unsupported) {
        context.report({ feature: element, unsupported });
    } else {
        for (let i = 0; i < node.attributes.length; i++) {
            validateAttribute(element, node.attributes[i], context);
        }
    }
};
github webhintio / hint / packages / hint-compat-api / src / html.ts View on Github external
const validateAttributeValue = (element: string, attr: HTMLAttribute, context: Context) => {
    if (context.ignore.has(`${element}[${attr.name}=${attr.value}]`)) {
        return;
    }

    const unsupported = getUnsupportedDetails({ attribute: attr.name, element, value: attr.value }, context.browsers);

    if (unsupported) {
        context.report({ feature: `${element}[${attr.name}=${attr.value}]`, unsupported });
    }
};