How to use the postcss-reporter/lib/util.getLocation function in postcss-reporter

To help you get started, we’ve selected a few postcss-reporter 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 stylelint / stylelint / lib / formatters / stringFormatter.js View on Github external
const cleanedMessages = orderedMessages.map(message => {
    const location = utils.getLocation(message);
    const severity = message.severity;
    const row = [
      location.line || "",
      location.column || "",
      symbols[severity]
        ? chalk[levelColors[severity]](symbols[severity])
        : severity,
      message.text
        // Remove all control characters (newline, tab and etc)
        .replace(/[\x01-\x1A]+/g, " ") // eslint-disable-line no-control-regex
        .replace(/\.$/, "")
        .replace(
          new RegExp(_.escapeRegExp("(" + message.rule + ")") + "$"),
          ""
        ),
      chalk.dim(message.rule || "")
github swissquote / crafty / packages / crafty-preset-postcss / src / lint_reporter.js View on Github external
const sourceGroupedMessages = messagesToLog.reduce((result, message) => {
      const key = util.getLocation(message).file || resultSource;
      if (!message.severity) {
        message.severity = message.type || "warning";
      }

      if (hasOwnProperty.call(result, key)) {
        result[key].push(message);
      } else {
        result[key] = [message];
      }
      return result;
    }, {});

postcss-reporter

Log PostCSS messages in the console

MIT
Latest version published 11 months ago

Package Health Score

77 / 100
Full package analysis

Similar packages