juanfran / gulp-scss-lint

Gulp plugin to lint scss files with `scss-lint`
113 stars 33 forks source link

Error when using failReporter and Checkstyle #41

Closed D34THWINGS closed 9 years ago

D34THWINGS commented 9 years ago

I have an error when using failReporter alongside with the Checkstyle reporter :

TypeError: Cannot read property 'success' of undefined at /mnt/hgfs/dev-meetic/webapp-desktop/node_modules/gulp-scss-lint/src/reporters.js:11:23

My gulp code is :

gulp
    .src([config.appStyles])
    .pipe(scssLint({
      reporterOutputFormat: 'Checkstyle',
      filePipeOutput: 'scss-report.xml'
    }))
    .pipe(scssLint.failReporter('E'))
    .pipe(gulp.dest('reports/lint'));

I want my task to fail if I have a lint error in my SCSS but still generating XML reports files for Jenkis, is it possible ? Am I doing it right ?

D34THWINGS commented 9 years ago

I found a way to make it work :

gulp
    .src([config.appStyles])
    .pipe(scssLint({
      reporterOutputFormat: 'Checkstyle',
      reporterOutput: path.resolve(process.cwd(), 'reports/', 'lint/', 'scss.xml')
    }))
    .pipe(scssLint.failReporter('E'));

Sorry for shouting to quickly and thanks for your work !