compactFormatter.js 371 B

1234567891011121314151617181920
  1. 'use strict';
  2. /**
  3. * @type {import('stylelint').Formatter}
  4. */
  5. const formatter = (results) =>
  6. results
  7. .flatMap((result) =>
  8. result.warnings.map(
  9. (warning) =>
  10. `${result.source}: ` +
  11. `line ${warning.line}, ` +
  12. `col ${warning.column}, ` +
  13. `${warning.severity} - ` +
  14. `${warning.text}`,
  15. ),
  16. )
  17. .join('\n');
  18. module.exports = formatter;