Coder Social home page Coder Social logo

jshint-stylish-summary's People

Contributors

greenkeeper[bot] avatar svenschoenung avatar

Watchers

 avatar

jshint-stylish-summary's Issues

Wrong file counts when used with gulp-jscs-stylish

Using jshint-stylish-summary together with gulp-jscs-stylish's combineWithHintResults() results in wrong file counts in the summary output.

Example:

gulp.task('default', () =>  {
  gulp.src(['app/**/*.js'])
    .pipe(jshint('.jshintrc'))
    .pipe(jscs())
    .pipe(jscsStylish.combineWithHintResults())
    .pipe(jshint.reporter('jshint-stylish'))
    .pipe(jshintSummary.collect())
    .on('end', jshintSummary.summarize())
});

If there are problems detected by both gulp-jscs and gulp-jshint in the same file you get the following nonsensical output:

nonsensical-summary

This shows two files as having warnings even though only one file was checked. The reason is that gulp-jscs-stylish's combineWithHintResults() uses absolute paths while gulp-jshint uses project-relative paths.

TypeError: Cannot read property '0' of undefined

Thanks for this module! Very useful.

We're running into a compatibility issue with gulp-jscs-stylish.

Here's what we're using:

jshint 2.9.1
jshint-stylish 2.1.0
jscs 2.11.0
gulp-jscs 3.0.2
gulp-jscs-stylish 1.3.0
gulp-jshint 2.0.0
gulp 3.9.1

node 5.10.0
npm 3.8.3

Our linting task is defined like this:

gulp.task('lint', () => 
  gulp.src(['app/**/*.js'])
    .pipe(jshint())
    .pipe(jscs())
    .pipe(jscsStylish.combineWithHintResults())
    .pipe(jshint.reporter('jshint-stylish'))
    .pipe(jshintSummary.collect())
    .on('end', jshintSummary.summarize())
);

gulp lint then results in:

stream.js:74
      throw er; // Unhandled stream error in pipe.
      ^

TypeError: Cannot read property '0' of undefined
  at /path/to/node_modules/jshint-stylish-summary/index.js:167:54

It works as expected if I remove the line

.pipe(jscsStylish.combineWithHintResults())

However, it also works as expected if I leave that line in and I replace /path/to/node_modules/jshint-stylish-summary/index.js:167 with

stats[opts.stat].config.push(file.jshint.results[0]);

It seems that the jscsStylish.combinWithHintResults() breaks/removes the file.jshint.data[0], but even without jscsStylish using file.jshint.results[0] seems to work as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.