Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylehint .pipe to gulp.dest causing unHandeled 'error' event #96

Open
AlexanderReen opened this issue Mar 2, 2018 · 1 comment
Open

Comments

@AlexanderReen
Copy link

AlexanderReen commented Mar 2, 2018

The following gulp task including a gulp.dest is causing an unclear unHandeled 'error' event.

gulp.task('lint-fix:scss', function () {
  var stylelint = require('gulp-stylelint');

  var run = function () {
    gutil.log(gutil.colors.cyan('stylelint') + ': Autofixing');

    // rules config is in .stylelintrc
    return gulp.src(config.lint.scss, { base: './' })
      .pipe(stylelint({ fix: true }))
      .pipe(gulp.dest('./'));
  };
  return run();
});

Causing this:

events.js:183
      throw er; // Unhandled 'error' event
      ^
Error: Failed with 323 errors

The second pipe is causing it, but not sure what exactly.

Running the most recent stylehint, gulp stylehint and scss packages for stylehint. Seems to be occuring on SASS as regular CSS files.

@olegskl
Copy link
Owner

olegskl commented Mar 3, 2018

It seems that stylelint is unable to fix all errors in your files and reports unfixed issues to gulp-stylelint, which emits the error you see. You can suppress this error by adding failAfterError: false to gulp-stylelint config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants