How to use the @hint/utils/dist/src/logging.error function in @hint/utils

To help you get started, we’ve selected a few @hint/utils 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 / parser-css / src / parser.ts View on Github external
try {
            await this.engine.emitAsync(`parse::start::css`, { resource });

            const result = await postcss().process(code, { from: resource, parser: safe });
            const ast = result.root!; // always defined even for '' (typings error?)

            await this.engine.emitAsync(`parse::end::css`, {
                ast,
                code,
                element,
                resource
            });

        } catch (err) /* istanbul ignore next */ {
            logger.error(`Error parsing CSS code: ${code} - ${err}`);
        }
    }
github webhintio / hint / packages / hint-no-vulnerable-javascript-libraries / src / hint.ts View on Github external
const vulnerabilities: Vulnerability[] = snykInfo.reduce((vulns, vuln) => {
                    const version = removeTagsFromVersion(lib.version) /* istanbul ignore next */ || '';

                    try {
                        vuln.semver.vulnerable.forEach((vulnVersion: string) => {
                            if (semver.satisfies(version, vulnVersion)) {
                                vulns.push(vuln);
                            }
                        });
                    } catch (e) {
                        logger.error(getMessage('versionNotCompliant', context.language, [version, lib.name]));
                    }

                    return vulns;
                }, [] as Vulnerability[]);