Skip to content

Instantly share code, notes, and snippets.

@bbrewer97202
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbrewer97202/72a43d71d51d87d2da8e to your computer and use it in GitHub Desktop.
Save bbrewer97202/72a43d71d51d87d2da8e to your computer and use it in GitHub Desktop.
webpack jshint-loader custom reporter example with filename and color formatting
var chalk = require('chalk');
module.exports = {
module: {
preLoaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "jshint-loader"
}
]
},
jshint: {
reporter: function(errors) {
console.log(chalk.underline.bgRed("jshint: " + this.resourcePath));
errors.forEach(function(error) {
console.log(chalk.cyan("line " + error.line + ": ") + error.reason);
});
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment