Code Monkey home page Code Monkey logo

jshint-loader-stylish's Introduction

JSHint-Loader Stylish Reporter

Notice: This package is no longer being maintained, as ESLint is prefered over JSHint for Webpack (especially since it can reference source files, not just line numbers). Please check that out instead, it's pretty awesome!

As a big fan of jshint-stylish, I really wanted to use it with a webpack-based build system. However, jshint-loader isn't compatible with normal reporters, so instead I forked jshint-stylish to create this! Error reporting resembles that of jshint, with a few slight differences due to what error data is returned from jshint-loader.

Usage

npm install --save-dev jshint-loader-stylish

// webpack.config.js
var stylishReporter = require('jshint-loader-stylish')({
  // options...
});

module.exports = exports = {
  module : {
    preLoaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'jshint'
    }],
  },
  jshint : {
    reporter : stylishReporter
  }
};

Reporter Styles

Since the regular jshint-stylish output doesn't work as well when errors can't be sorted by file, the default output has been adjusted slightly to give you a bit more information:

default reporter

If you wish to enable the reporter that more closely adheres to vanilla jshint-stylish output, set the style configuration property to "true-stylish".

require('jshint-loader-stylish')({
  style : 'true-stylish'
});

true-stylish reporter

Options

style [string]

Use the style configuration to reference the name of the reporter style you wish to use. These can be found in jshint-loader-stylish/reporters.

TODO

  • Is there a way to get jshint-loader to reference file names?

Credits

Based on jshint-stylish by sindresorhus.

jshint-loader-stylish's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jshint-loader-stylish's Issues

Routes return error: TypeError: Cannot read property 'forEach' of undefined

This happens for all my route, not sure why specifically only those....

./src/scripts/components/Application.js
Module build failed: TypeError: Cannot read property 'forEach' of undefined
    at forEach (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader-stylish/node_modules/text-table/index.js:73:11)
    at /Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader-stylish/node_modules/text-table/index.js:10:9
    at Array.reduce (native)
    at reduce (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader-stylish/node_modules/text-table/index.js:63:30)
    at module.exports (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader-stylish/node_modules/text-table/index.js:9:20)
    at Object.<anonymous> (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader-stylish/reporters/true-stylish.js:30:17)
    at Object.jsHint (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader/index.js:110:13)
    at Object.<anonymous> (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader/index.js:146:11)
    at Object.<anonymous> (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader/index.js:37:12)
    at respond (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader/node_modules/rcloader/index.js:68:7)
    at respond (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader/node_modules/rcloader/node_modules/rcfinder/index.js:140:7)
    at next (/Users/mmahalwy/Desktop/Code/quran.com/frontend/node_modules/jshint-loader/node_modules/rcloader/node_modules/rcfinder/index.js:167:16)
    at process._tickCallback (node.js:355:11)
 @ ./app.js 13:29-62

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.