1.0.0 • Published 6 years ago

stylelint-formatter-simplest v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

stylelint-formatter-simplest

npm version Build Status Coverage Status

A stylelint formatter to just identify whether there's any warnings or not

Installation

Use npm.

npm install stylelint-formatter-simplest

API

const stylelintFormatterSimplest = require('stylelint-formatter-simplest');

stylelintFormatterSimplest(stylelintResults)

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
}]); //=> ''

License

ISC License © 2018 Shinnosuke Watanabe