cssrecipes / stylelint-config-cssrecipes

cssrecipes shareable config for stylelint
MIT License
12 stars 0 forks source link

Doesn't work with gulp-postcss #8

Closed TrySound closed 8 years ago

TrySound commented 8 years ago
[01:58:05] TypeError in plugin 'gulp-postcss'
Message:
    Object.keys called on non-object

With standard config everything fine. Maybe some rules somehow break warnings?

jeddy3 commented 8 years ago

I can't seem to replicate this. No warnings with stylelint-config-cssrecipes@2.0.0, gulp-postcss@6.0.1 and gulp@3.9.0.

My gulpfile is this:

var postcss = require('gulp-postcss');
var gulp = require('gulp');
var stylelint = require('stylelint');

gulp.task('default', function () {
    var processors = [stylelint()];
    return gulp.src('css/temp.css')
        .pipe(postcss(processors));
});

And the config specified in the package.json:

{
  "stylelint": {
    "extends": "stylelint-config-cssrecipes"
  }
}

Can you please paste your gulpfile here so we can try to get to the bottom of this? :)

MoOx commented 8 years ago

And what version are you using @TrySound ?

TrySound commented 8 years ago

Seems like the problem since indentation rule in postcssPlugin.js

indentation: [ 2, 2, { hierarchicalSelectors: true } ]
TrySound commented 8 years ago

Here is number https://github.com/stylelint/stylelint/blob/master/src/utils/validateOptions.js#L54

TrySound commented 8 years ago

Yep. Actual is not checked. Only possible.

TrySound commented 8 years ago

This works fine.

indentation: 2
TrySound commented 8 years ago

Oh, I understand. It can't validate old syntax. But should.

TrySound commented 8 years ago

Think we should also check the second element here https://github.com/stylelint/stylelint/blob/master/src/postcssPlugin.js#L64