{"id":20163,"library":"jshint-loader","title":"jshint-loader","description":"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.","status":"maintenance","version":"0.8.4","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/webpack/jshint-loader","tags":["javascript"],"install":[{"cmd":"npm install jshint-loader","lang":"bash","label":"npm"},{"cmd":"yarn add jshint-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add jshint-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to perform linting","package":"jshint","optional":false}],"imports":[{"note":"Loader is used via Webpack config, not imported directly.","wrong":"const jshintLoader = require('jshint-loader');","symbol":"default","correct":"module.exports = { module: { preLoaders: [{ test: /\\.js$/, exclude: /node_modules/, loader: 'jshint-loader' }] } }"},{"note":"Options are placed under the 'jshint' key in Webpack config.","wrong":"const jshint = require('jshint-loader').config;","symbol":"jshint config object","correct":"module.exports = { jshint: { camelcase: true } }"},{"note":"Reporter receives array of errors and uses loader context (this.emitWarning/Error). Standard JSHint reporters are not compatible.","wrong":"// Using standard JSHint reporter like 'jshint-stylish'","symbol":"reporter function","correct":"module.exports = { jshint: { reporter: function(errors) { this.emitWarning(errors[0].reason); } } }"}],"quickstart":{"code":"npm install jshint-loader jshint --save-dev\n\n// webpack.config.js\nmodule.exports = {\n  module: {\n    preLoaders: [\n      {\n        test: /\\.js$/,\n        exclude: /node_modules/,\n        loader: 'jshint-loader'\n      }\n    ]\n  },\n  jshint: {\n    curly: true,\n    eqeqeq: true,\n    emitErrors: true,\n    failOnHint: false\n  }\n};","lang":"javascript","description":"Install jshint-loader and jshint, then configure Webpack to run JSHint as a pre-loader with options."},"warnings":[{"fix":"For Webpack 2+, use: rules: [{ test: /\\.js$/, enforce: 'pre', exclude: /node_modules/, loader: 'jshint-loader' }]","message":"In Webpack 1, preLoaders key is used; in Webpack 2+ it has been replaced by 'rules' with 'enforce: pre'.","severity":"breaking","affected_versions":">=1.0.0 <2.0.0"},{"fix":"Use module.rules with enforce: 'pre' instead of preLoaders.","message":"Webpack 2+ deprecated preLoaders in favor of enforce: pre.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Implement a custom reporter function that uses this.emitWarning() or this.emitError()","message":"Standard JSHint reporters are not compatible with jshint-loader. They will not produce output.","severity":"gotcha","affected_versions":">=0.8.0"},{"fix":"Ensure test pattern includes files you want linted and exclude node_modules.","message":"Loader will not run on files excluded by /node_modules/ unless explicitly included.","severity":"gotcha","affected_versions":">=0.8.0"}],"env_vars":null,"search_vec":"'0.8.4':25 '2017':29 'build':18 'bundl':47 'check':43 'compat':64 'current':21 'custom':52 'depend':75 'differenti':49 'emit':56 'error':57 'februari':28 'file':45 'integr':12 'javascript':44,76 'jshint':2,5,13,36,67,71 'jshint-load':1,4 'key':48 'lint':14 'loader':3,6,10,41 'peer':74 'pre':40 'pre-load':39 'process':19 'releas':26 'report':53,61,68 'requir':70 'run':35 'stabl':22 'standard':66 'support':51 'updat':33 'version':23 'warn':59 'webpack':9,17","created_at":"2026-04-25T11:21:39.288879+00:00","updated_at":"2026-04-25T11:21:39.288879+00:00","problems":[{"fix":"Update config: module: { rules: [{ test: /\\.js$/, enforce: 'pre', loader: 'jshint-loader' }] }","cause":"jshint-loader is used as pre-loader but Webpack 2+ expects 'enforce: pre' instead of preLoaders.","error":"Module parse failed: Unexpected token (1:2)\nYou may need an appropriate loader to handle this file type."},{"fix":"Ensure jshint key in config is an object with valid options.","cause":"jshint options object is missing or malformed.","error":"ERROR in ./src/app.js\nModule build failed: TypeError: Cannot read property 'length' of undefined"},{"fix":"Check that reporter is a function set under jshint.reporter.","cause":"Custom reporter function may not be passed correctly or is not exporting properly.","error":"WARNING: No reporter specified. Using default."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/webpack/jshint-loader","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/jshint-loader","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}