A stylelint formatter to just identify whether there's any warnings or not
npm install stylelint-formatter-simplest
const stylelintFormatterSimplest = require('stylelint-formatter-simplest');
stylelintResults: Array<Object>
Return: string
('!'
or ''
)
When at least one of the stylelint results is not ignored and has either non-empty warnings
or invalidOptionWarnings
, it returns a single character !
. Otherwise it returns an empty string.
stylelintFormatterSimplest([{
source: '/Users/shinnn/fixture.css',
deprecations: [],
invalidOptionWarnings: [],
parseErrors: [],
errored: true,
warnings: [{
line: 1,
column: 2,
rule: 'block-no-empty',
severity: 'error',
text: 'Unexpected empty block (block-no-empty)'
}],
ignored: false
}]); //=> '!'
stylelintFormatterSimplest([{
source: '/Users/shinnn/another-fixture.css',
deprecations: [],
invalidOptionWarnings: [],
parseErrors: [],
errored: false,
warnings: [],
ignored: false
}]); //=> ''
ISC License © 2018 Shinnosuke Watanabe