svenschoenung / jshint-stylish-summary Goto Github PK
View Code? Open in Web Editor NEWA stylish summary reporter for jshint
License: MIT License
A stylish summary reporter for jshint
License: MIT License
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:
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.