mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-20 17:03:42 +00:00
24 lines
492 B
JavaScript
24 lines
492 B
JavaScript
'use strict';
|
|
|
|
const preprocessWarnings = require('./preprocessWarnings');
|
|
|
|
/**
|
|
* @type {import('stylelint').Formatter}
|
|
*/
|
|
module.exports = 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');
|
|
};
|