jshint-loader is a Webpack loader that integrates JSHint linting into the Webpack build process. The current stable version is 0.8.4, released in February 2017, with no further updates. It runs JSHint as a pre-loader to check JavaScript files before bundling. Key differentiators: it supports custom reporters and can emit errors or warnings, but reporters are not compatible with standard JSHint reporters. It requires JSHint as a peer dependency.
npm install jshint-loaderVerified import paths — ran on the pinned version, not inferred.
Install jshint-loader and jshint, then configure Webpack to run JSHint as a pre-loader with options.
For Webpack 2+, use: rules: [{ test: /\.js$/, enforce: 'pre', exclude: /node_modules/, loader: 'jshint-loader' }]Use module.rules with enforce: 'pre' instead of preLoaders.
Implement a custom reporter function that uses this.emitWarning() or this.emitError()
Ensure test pattern includes files you want linted and exclude node_modules.
Update config: module: { rules: [{ test: /\.js$/, enforce: 'pre', loader: 'jshint-loader' }] }Ensure jshint key in config is an object with valid options.
Check that reporter is a function set under jshint.reporter.