Files
ccszjs/node_modules/stylelint/lib/formatters/compactFormatter.mjs
renjianbo 12ccebc477 sec
2026-07-18 16:31:27 +08:00

22 lines
473 B
JavaScript

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