lazd / gulp-csslint

CSSLint plugin for gulp
MIT License
74 stars 12 forks source link

How to pass in --quiet param? #55

Closed Spunkie closed 8 years ago

Spunkie commented 8 years ago

On the csslint cli there is a --quiet param that suppresses warnings and only displays errors but I can't for the life of me figure out how to pass this param in gulp-csslint.

https://github.com/CSSLint/csslint/wiki/Command-line-interface#--quiet

I've tried passing it into csslint and csslint.reporter both with and without dashes plus a bunch of other formats. These are the basic ones I tried to give you an idea what I'm doing.

.pipe(csslint({'quiet': true})) //Nothing Happens
.pipe(csslint({'--quiet': true})) //Nothing Happens
.pipe(csslint.reporter('', {'quiet': true})) //Error: Invalid reporter
.pipe(csslint.reporter('', {'--quiet': true})) //Error: Invalid reporter

Is this possible with gulp-csslint?

Spunkie commented 8 years ago

Also calling @SimenB since he seems to know his way around this repo and is significantly more active than the owner.

SimenB commented 8 years ago

Try passing in undefined as the first param, then you should be able to pass quiet into reporter (untested, I don't have any projects using gulp-csslint on my machine).

.pipe(csslint.reporter(undefined, {quiet: true}))

Another change in #29 is that you can pass falsey values as the first argument, so your current example should work with that.

Although, quiet just makes it output nothing if there's nothing to report, there is currently no way to just display errors. You can create a custom formatter for it soon (#29).

Spunkie commented 8 years ago

@SimenB Ah yes thanks... I see now that I've been misreading what that param does. Hopefully #29 can get merged in soon, csslint-stylish is pretty much the last piece missing from my new build chain.

alfredbez commented 7 years ago

This does not work for me:

.pipe(csslint())
.pipe(csslint.formatter(undefined, {quiet: true}))

I tried it also with reporter instead of formatter. Any ideas?

SimenB commented 7 years ago

What doesn't work about it? (formatter is correct, btw)

alfredbez commented 7 years ago

It outputs warnings, too.

alfredbez commented 7 years ago

I found another way:

create a .csslintrc:

{
  "order-alphabetical": false,
  "important": false,
  "adjoining-classes": false,
  "known-properties": false,
  "box-sizing": false,
  "box-model": false,
  "overqualified-elements": false,
  "display-property-grouping": false,
  "bulletproof-font-face": false,
  "compatible-vendor-prefixes": false,
  "regex-selectors": false,
  "errors": true,
  "duplicate-background-images": false,
  "duplicate-properties": false,
  "empty-rules": false,
  "selector-max-approaching": false,
  "gradients": false,
  "fallback-colors": false,
  "font-sizes": false,
  "font-faces": false,
  "floats": false,
  "star-property-hack": false,
  "outline-none": false,
  "import": false,
  "ids": false,
  "underscore-property-hack": false,
  "rules-count": false,
  "qualified-headings": false,
  "selector-max": false,
  "shorthand": false,
  "text-indent": false,
  "unique-headings": false,
  "universal-selector": false,
  "unqualified-attributes": false,
  "vendor-prefix": false,
  "zero-units": false,
  "import-ie-limit": false,
  "selector-newline": false
}
.pipe(csslint('.csslintrc'))
.pipe(csslint.formatter());
SimenB commented 7 years ago

Yes, there's currently no API for it, like mentioned above

Although, quiet just makes it output nothing if there's nothing to report, there is currently no way to just display errors. You can create a custom formatter for it soon (#29).