by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 20 2018 09:49
  • Nov 13 2018 09:26
    dsine-de starred olegskl/gulp-stylelint
  • Nov 05 2018 10:05
    klihelp starred olegskl/gulp-stylelint
  • Nov 05 2018 08:35
    obuisan starred olegskl/gulp-stylelint
  • Oct 30 2018 18:00
    XhmikosR starred olegskl/gulp-stylelint
  • Oct 24 2018 12:23
    olegskl commented #105
  • Oct 24 2018 12:15

    olegskl on 8.0.0

    (compare)

  • Oct 24 2018 12:15

    olegskl on master

    chore(package): bump version to… (compare)

  • Oct 24 2018 12:11

    olegskl on master

    Fix reporting for ignored files Add node > 6, node <= 10 to tra… Enforce stylelint@^9.6.0 (compare)

  • Oct 24 2018 12:11
    olegskl closed #105
  • Oct 20 2018 22:20
    mtvphnx starred olegskl/gulp-stylelint
  • Oct 20 2018 22:20
    mtvphnx commented #105
  • Oct 17 2018 11:01
    ilyagorev starred olegskl/gulp-stylelint
  • Oct 16 2018 22:05
    Azein commented #105
  • Oct 16 2018 11:17
    perrin4869 synchronize #105
  • Oct 16 2018 08:07
    perrin4869 commented #105
  • Oct 16 2018 07:59
    perrin4869 synchronize #105
  • Oct 16 2018 07:57
    perrin4869 synchronize #105
  • Oct 16 2018 07:21
    perrin4869 commented #105
  • Oct 16 2018 07:20
    perrin4869 synchronize #105
spritzel
@spritzel
not the most elegant solution but it'll do until something better comes up! :)
Oleg Sklyanchuk
@olegskl
Yeah. But of course you're not linting them :)
You might want to open an issue on postcss-scss
spritzel
@spritzel
yea,
thinking about how to phrase it!
uhmm yea I'm not linting them, but I think those are generated stylesheet
for now just worry about linting what our devs wrote :)
Oleg Sklyanchuk
@olegskl
:)
spritzel
@spritzel
postcss/postcss-scss#23
FYI
not sure if it's properly worded
Oleg Sklyanchuk
@olegskl
Just wanted to mention that you aren't actually using gulp-stylelint :P
spritzel
@spritzel
oh dang
lol
you're right, I've been experimenting a bunch, I was still requiring gulp-stylelint but it wasnt in use
thanks for your help anyways
Oleg Sklyanchuk
@olegskl
^_^
Wei
@xowei

hey guys, i have one problem when using gulp-stylelint
It gave me a error message below:

Error in plugin 'gulp-stylelint'
Message:
    No configuration found
Details:
    code: 78

my gulp task is like this:

gulp.task('lint-css', function() {

  var stylelintConfig = {
    'plugins': [
      'stylelint-statement-max-nesting-depth'
    ],
    'rules': {
      'selector-pseudo-element-colon-notation': 'single',
      'statement-max-nesting-depth': [2, { countAtRules: true }],
    }
  };

  return gulp.src(src + css + cofiles)
    .pipe($.stylelint(stylelintConfig));
});
hope someone can help me, sorry for my bad english..
Oleg Sklyanchuk
@olegskl
Hello, what version of gulp-stylelint are you using?
Wei
@xowei
@olegskl I use 2.0.2
Oleg Sklyanchuk
@olegskl
gulp-stylelint takes an object of stylelint options (http://stylelint.io/user-guide/node-api/#options), so you need to add a config property that points to the actual config.
.pipe($.stylelint({config: stylelintConfig}));
Wei
@xowei
@olegskl Thank you! I fixed it!
Wei
@xowei

sorry, i have another problem now =(
This is my stylelintConfig

  var stylelintConfig = {
    "rules": {
      "block-no-empty": null,
      "color-no-invalid-hex": true,
      "comment-empty-line-before": [ "always", {
        "ignore": ["stylelint-commands", "between-comments"],
      } ],
      "declaration-colon-space-after": "always-single-line",
      "indentation": 2,
      "rule-nested-empty-line-before": [ "always-multi-line", {
        "except": ["first-nested"],
        "ignore": ["after-comment"],
      } ],
      "unit-whitelist": ["em", "rem", "%", "s", "deg"]
    }
  };

This is my nav.css file

nav {
  ul {
   margin: 0;
   padding: 0;
  }
}

error message is:

src/css/layout/nav.css
2:3     ‼  Expected indentation of 0 spaces (indentation) [stylelint]

What happen? Please help me~

Oleg Sklyanchuk
@olegskl
I've set up a test case for you:
const gulp = require('gulp');
const stylelint = require('gulp-stylelint');

gulp.task('lint', function () {
  const stylelintConfig = {
    "rules": {
      "block-no-empty": null,
      "color-no-invalid-hex": true,
      "comment-empty-line-before": [ "always", {
        "ignore": ["stylelint-commands", "between-comments"],
      } ],
      "declaration-colon-space-after": "always-single-line",
      "indentation": 2,
      "rule-nested-empty-line-before": [ "always-multi-line", {
        "except": ["first-nested"],
        "ignore": ["after-comment"],
      } ],
      "unit-whitelist": ["em", "rem", "%", "s", "deg"]
    }
  };

  gulp.src('*.css')
    .pipe(stylelint({
      config: stylelintConfig,
      reporters: [
        {formatter: 'string', console: true}
      ],
    }));
});
now, if you run gulp lint you'll get:
foo.css
 3:4  ✖  Expected indentation of 4 spaces   indentation
 4:4  ✖  Expected indentation of 4 spaces   indentation
Because in your css file you indent nested rule's properties with three spaces.
Also, I don't think that block-no-empty rule takes null as value.
Oleg Sklyanchuk
@olegskl
And if you have questions related to stylelint rule, I think you'll get faster and better answers if you ask them in https://gitter.im/stylelint/stylelint room. gulp-stylelint plugin exist just to make stylelint work in gulp, it doesn't do any linting logic itself.
Wei
@xowei
@olegskl Okay, thanks anyway.
Jitendra Vyas
@jitendravyas
We can show error in CLI from stylelint but how to prevent developers to push the css file if they do not solve error?
Oleg Sklyanchuk
@olegskl
@jitendravyas you can use a pre-push git hook which runs your lint command. If lint command fails, it will abort the push.
Jitendra Vyas
@jitendravyas
ok. Will have to take help from Dev Ops people then. Thanks for reply.
syedsimanta03
@syedsimanta03
I installed stylelint globally via NPM and have my .stylelintrc file setup for project. Do I still need the vs code stylelint plugin?
Marcy
@marchica
hi! anyone around? trying to use fix in a gulp watch but getting an infinite loop
const gulpStylelint = require('gulp-stylelint');
const { src, dest, watch, lastRun } = require('gulp');
function cssLint() {
    return src('./src/css/*.css', {since: lastRun(cssLint)})
        .pipe(gulpStylelint({fix: true, reporters: [{formatter: 'string', console: true}]}))
        .pipe(dest('./src/css/'));
}
function watcher() {
    watch('./src/css/*.css', cssLint);
}
exports.cssLint = cssLint;
exports.watch = watcher;
syedsimanta03
@syedsimanta03
OS related question what u prefer for web and app dev- apple Mac os or Linux?
Marcy
@marchica
@syedsimanta03 who me? why? I prefer Gentoo Linux but outside of work I don't turn my computer on much other than to game or recently for my new side project which is for Windows
@syedsimanta03 did you get an answer to your question from Feb? i haven't tried it but my guess is you only need the VS Code plugin if you want to see the problems listed in the problems window or with the red squiggly under the text in the files
syedsimanta03
@syedsimanta03
@marchica thank you