How to use the hint/dist/src/lib/types.Severity.warning function in hint

To help you get started, we’ve selected a few hint 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-axe / src / hint.ts View on Github external
/* istanbul ignore next */
            try {
                result = await context.evaluate(script);
            } catch (e) {
                let message: string;

                if (e.message.includes('evaluation exceeded')) {
                    message = getMessage('notFastEnough', context.language);
                } else {
                    message = getMessage('errorExecuting', context.language, e.message);
                }

                message = getMessage('tryAgainLater', context.language, message);

                context.report(resource, message, { severity: Severity.warning });
                debug('Error executing script %O', e);

                return;
            }

            /* istanbul ignore next */
            if (!result || !Array.isArray(result.violations)) {
                debug(`Unable to parse axe results ${result}`);

                return;
            }

            if (result.violations.length === 0) {
                debug('No accessibility issues found');

                return;