UNPKG

stylelint

Version:

A mighty CSS linter that helps you avoid errors and enforce conventions.

24 lines (19 loc) 498 B
import preprocessWarnings from './preprocessWarnings.mjs'; /** * @type {import('stylelint').Formatter} */ export default function compactFormatter(results) { const lines = results.flatMap((result) => { const { warnings } = preprocessWarnings(result); return warnings.map( (warning) => `${result.source}: ` + `line ${warning.line}, ` + `col ${warning.column}, ` + `${warning.severity} - ` + `${warning.text}`, ); }); lines.push(''); return lines.join('\n'); }