Coder Social home page Coder Social logo

reporter-plus's Introduction

Reporter Plus

Reporter Plus is a reporter script for JSHint and JSCS with stylized output and notifications.

Whazzat

Reporter Plus is designed to reduce the amount of cmd+tabbing around you've got to do while linting and fixing your code. The ideal workflow (in my humble opinion), is to set up JSHint and JSCS to check on save with a watch task (try grunt-contrib-watch) and a git pre-commit hook (try precommit-hook).

When you save a watched file or attempt to make a commit with a mistake in it, Reporter Plus will send a notification. Clicking on the notification will open all of the relevant files, as well as a text file with a summary of all the errors in the report.

This repo doesn't have a watch task, but take a look at the package.json and Gruntfile.js to see an example of the pre-commit hook in situ.

Reporter Plus also provides some nicer formatting for the command-line output than the default reporters, heavily influenced by jshint-stylish.

Requirements

Also, if you want to open reports directly from notifications, you'll probably want to configure your EDITOR environment variable. For example, here's how to do so for Sublime Text: https://www.sublimetext.com/docs/2/osx_command_line.html

Installation and setup

Install with npm install --save-dev jayeb/reporter-plus

To run from command line:

$ jshint --reporter=jshint/jshint.js ./lib

# or...

$ jscs --reporter=jscs/index.js ./lib

Or, if you're using grunt-contrib-jshint or grunt-jscs, you can put something like this in your Gruntfile:

grunt.initConfig({
  jshint: {
      src: '*.js',
      options: {
          jshintrc: '.jshintrc',
          reporter: require('reporter-plus/jshint')
        }
    },
  jscs: {
      src: '*.js',
      options: {
          config: '.jscsrc',
          reporter: require('reporter-plus/jscs').path
        }
    }
});

You'll notice that the protocol for referencing the reporter is different between JSHint and JSCS. I don't know, man, that's just the way it is. Some things will never change.

Ah, but don't you believe them.

reporter-plus's People

Contributors

jayeb avatar

Watchers

 avatar  avatar

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.