All Projects → webpack-contrib → Jshint Loader

webpack-contrib / Jshint Loader

Licence: mit
[DEPRECATED] jshint loader for webpack, please migrate on `eslint`

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jshint Loader

Bundle Loader
Bundle Loader
Stars: ✭ 666 (+865.22%)
Mutual labels:  webpack-loader
Less Loader
Compiles Less to CSS
Stars: ✭ 851 (+1133.33%)
Mutual labels:  webpack-loader
Ng Router Loader
Webpack loader for NgModule lazy loading using the angular router
Stars: ✭ 47 (-31.88%)
Mutual labels:  webpack-loader
Node Config Loader
Scan directories and loads config json and yaml files
Stars: ✭ 5 (-92.75%)
Mutual labels:  webpack-loader
Angular2 Load Children Loader
A webpack loader for ng2 lazy loading
Stars: ✭ 23 (-66.67%)
Mutual labels:  webpack-loader
Thread Loader
Runs the following loaders in a worker pool
Stars: ✭ 945 (+1269.57%)
Mutual labels:  webpack-loader
Wasm Loader
✨ WASM webpack loader
Stars: ✭ 604 (+775.36%)
Mutual labels:  webpack-loader
Isomorphine
Require server-side modules from the browser, remotely.
Stars: ✭ 66 (-4.35%)
Mutual labels:  webpack-loader
Stylefmt Loader
Webpack-loader. Fixes stylelint issues automatically while bundling with Webpack.
Stars: ✭ 24 (-65.22%)
Mutual labels:  webpack-loader
Bootstrap Loader
Load Bootstrap styles and scripts in your Webpack bundle
Stars: ✭ 1,038 (+1404.35%)
Mutual labels:  webpack-loader
Inline Style Loader
inline style loader for webpack
Stars: ✭ 16 (-76.81%)
Mutual labels:  webpack-loader
Nunjucks Isomorphic Loader
Nunjucks loader for webpack, supporting both javascript templating and generating static HTML files through the HtmlWebpackPlugin.
Stars: ✭ 17 (-75.36%)
Mutual labels:  webpack-loader
Mpx Webpack Plugin
原生小程序开发定制 webpack 插件套装
Stars: ✭ 34 (-50.72%)
Mutual labels:  webpack-loader
Raw Loader
A loader for webpack that allows importing files as a String
Stars: ✭ 800 (+1059.42%)
Mutual labels:  webpack-loader
Html Loader
HTML Loader
Stars: ✭ 1,067 (+1446.38%)
Mutual labels:  webpack-loader
Cache Loader
[DEPRECATED] Caches the result of following loaders on disk
Stars: ✭ 630 (+813.04%)
Mutual labels:  webpack-loader
Flow Bin Loader
webpack loader for Flow
Stars: ✭ 11 (-84.06%)
Mutual labels:  webpack-loader
Sketch Loader
Webpack loader for Sketch (+43) files
Stars: ✭ 69 (+0%)
Mutual labels:  webpack-loader
Laravel Localization Loader
Laravel Localization loader for webpack. Convert Laravel Translation strings to JavaScript Objects.
Stars: ✭ 58 (-15.94%)
Mutual labels:  webpack-loader
Svgr
Transform SVGs into React components 🦁
Stars: ✭ 8,263 (+11875.36%)
Mutual labels:  webpack-loader

npm node deps tests chat

jshint-loader

A JSHint loader module for webpack. Runs JSHint on JavaScript files in a bundle at build-time.

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you'll need to install jshint-loader:

$ npm install jshint-loader --save-dev

Then add the loader to your webpack config. For example:

// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /.js/,
        enforce: 'pre',
        exclude: /node_modules/,
        use: [
          {
            loader: `jshint-loader`,
            options: {...options}
          }
        ]
      }
    ]
  }
}

And run webpack via your preferred method.

Options

All valid JSHint options are valid on this object, in addition to the custom loader options listed below:

delete options.; delete options.; delete options.;

emitErrors

Type: Boolean Default: undefined

Instructs the loader to emit all JSHint warnings and errors as webpack errors.

failOnHint

Type: Boolean Default: undefined

Instructs the loader to cause the webpack build to fail on all JSHint warnings and errors.

reporter

Type: Function Default: undefined

A function used to format and emit JSHint warnings and errors.

Custom Reporter

By default, jshint-loader will provide a default reporter.

However, if you prefer a custom reporter, pass a function under the reporter property in jshint options. (see usage above)

The reporter function will be passed an array of errors/warnings produced by JSHint with the following structure:

[
{
    id:        [string, usually '(error)'],
    code:      [string, error/warning code],
    reason:    [string, error/warning message],
    evidence:  [string, a piece of code that generated this error]
    line:      [number]
    character: [number]
    scope:     [string, message scope;
                usually '(main)' unless the code was eval'ed]

    [+ a few other legacy fields that you don't need to worry about.]
},
// ...
// more errors/warnings
]

The reporter function will be excuted with the loader context as this. You may emit messages using this.emitWarning(...) or this.emitError(...). See webpack docs on loader context.

Note: JSHint reporters are not compatible with JSHint-loader! This is due to the fact that reporter input is only processed from one file; not multiple files. Error reporting in this manner differs from traditional reporters for JSHint since the loader plugin (i.e. JSHint-loader) is executed for each source file; and thus the reporter is executed for each file.

The output in webpack CLI will usually be:

...
WARNING in ./path/to/file.js
<reporter output>
...

`

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].