Skip to content

s4tori/jshint-smart

Repository files navigation

jshint-smart

NPM version Build status Dependency Status

Responsive reporter for JSHint

Example

On Linux :

screenshot

On Windows :

screenshot

The column "Code" will be displayed only if you run JSHint with a flag --verbose.
The column "Evidence" will be displayed only if there is enough space.

Install

$ npm install --save-dev jshint-smart

Usage

grunt.initConfig({
    jshint: {
		options: {
			reporter: require("jshint-smart"),
			verbose: false, // if true : show warning code
		},
		target: ["file.js"]
	}
});

grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.registerTask("default", ["jshint"]);
gulp.task("jshint", function () {
	return gulp.src(["file.js"])
		.pipe(jshint())
		.pipe(jshint.reporter("jshint-smart", { verbose: false })) // if true  : show warning code
		.pipe(jshint.reporter("fail"));                            // optional : fail when a JSHint error happens
});

gulp.task("default", ["jshint"]);
exports.config = {
	files: { },
	plugins: {
		jshint: {
			pattern: /^app(\/|\\).*\.js$/,
			reporter: "jshint-smart"
		}
	}
};
jshint file.js --reporter=./node_modules/jshint-smart/lib/jshint-smart.js

About

Responsive reporter for JSHint

Resources

License

Stars

Watchers

Forks

Packages

No packages published