Skip to content

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

License

Notifications You must be signed in to change notification settings

shinnn/stylelint-formatter-simplest

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published