Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/stylelint-formatter-simplest
A stylelint formatter to just identify whether there're any warnings or not
https://github.com/shinnn/stylelint-formatter-simplest
formatter javascript lint nodejs simple styelint stylelint-formatter
Last synced: about 1 month ago
JSON representation
A stylelint formatter to just identify whether there're any warnings or not
- Host: GitHub
- URL: https://github.com/shinnn/stylelint-formatter-simplest
- Owner: shinnn
- License: isc
- Created: 2018-08-22T00:51:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-22T01:00:37.000Z (about 6 years ago)
- Last Synced: 2024-10-13T23:47:15.728Z (about 1 month ago)
- Topics: formatter, javascript, lint, nodejs, simple, styelint, stylelint-formatter
- Language: JavaScript
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stylelint-formatter-simplest
[![npm version](https://img.shields.io/npm/v/stylelint-formatter-simplest.svg)](https://www.npmjs.com/package/stylelint-formatter-simplest)
[![Build Status](https://travis-ci.com/shinnn/stylelint-formatter-simplest.svg?branch=master)](https://travis-ci.com/shinnn/stylelint-formatter-simplest)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/stylelint-formatter-simplest.svg)](https://coveralls.io/github/shinnn/stylelint-formatter-simplest?branch=master)A [stylelint](https://github.com/stylelint/stylelint) [formatter](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/node-api.md#formatter) to just identify whether there's any warnings or not
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).
```
npm install stylelint-formatter-simplest
```## API
```javascript
const stylelintFormatterSimplest = require('stylelint-formatter-simplest');
```### stylelintFormatterSimplest(*stylelintResults*)
*stylelintResults*: `Array`
Return: `string` (`'!'` or `''`)When at least one of the [stylelint result](https://github.com/stylelint/stylelint/blob/master/docs/developer-guide/formatters.md)s is not [ignore](https://github.com/stylelint/stylelint/blob/master/docs/user-guide/configuration.md#stylelintignore)d and has either non-empty `warnings` or `invalidOptionWarnings`, it returns a single character `!`. Otherwise it returns an empty string.
```javascript
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](./LICENSE) © 2018 Shinnosuke Watanabe