Coder Social home page Coder Social logo

jslint-reporter's Introduction

JSLint Reporter
Node.js wrapper for JSLint <http://jslint.com>


----

โš  NOTE: This wrapper no longer constitutes the state of the art. We recommend
        using one of the alternatives listed below.

----


Usage:

  $ jslint-reporter [options] <filepath>

(use `--upgrade` to generate jslint.js alongside wrapper.js)


Options:

  --<name>[=<value>]
    names as per http://www.jslint.com/lint.html#options
    (e.g. "--vars --predef=foo,bar,baz --maxlen=80")

  --format=<format>
    output format, using the following placeholders:
    {f}: file    {l}: line    {c}: character    {m}: message
    defaults to "{f}:{l}:{c}:{m}"

  --upgrade
    download latest version of JSLint

  --verbose
    display additional information

  --version
    display version numbers for both JSLint Reporter and JSLint

  --help
    display this usage information


Alternatives
------------

* see <https://github.com/douglascrockford/JSLint/wiki/JSLINT>
* JSHint <http://jshint.com>
* ESLint <http://eslint.org>

jslint-reporter's People

Contributors

feklee avatar fnd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jslint-reporter's Issues

issue with command node wrapper.js --upgrade

hello.

this command warn me this error message :

TypeError: Cannot read property 'edition' of undefined
at main (/home/christophe/dotfiles/emacs/.emacs.d/jslint-reporter/wrapper.js:69:42)
at /home/christophe/dotfiles/emacs/.emacs.d/jslint-reporter/wrapper.js:51:4
at IncomingMessage. (/home/christophe/dotfiles/emacs/.emacs.d/jslint-reporter/wrapper.js:131:4)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:929:16
at process._tickCallback (node.js:419:13)

Btw i already have jslint.js, don't know if it can help to understand.

Make output compatible with VisualStudio

This small change to formatOutput in wrapper.js changes output formatting so that in VisualStudio, you can double-click on an warning/error to jump to the line in the code.

//var line = [filepath, error.line, error.character, error.reason].join(":");
// format for VisualStudio
var line = [ filepath + "(" + error.line + ")", error.character, error.reason].join(":");

predefined $ (jQuery)

how do I run the script so that it accepts $ function?
currently

$(document).ready(function(data) {
});

throws this error:

inventory.js:92:1:'$' was used before it was defined.
inventory.js:92:3:'document' was used before it was defined.

I tried predefined=[$], predefined=['$'], predefined=$, predefined='$', predefined='[$]' and a few others (without really knowing what I'm doing).

use stdout in stead of util.print and no stdout.flush()

Dear FND

I'm using the jslint-reporter with node.js on windows and ran into two problems.

  1. You use util.print for printing the errors (line 82) but stderr.write for everthing else. When using the wrapper from the console, this works fine, but running it as a subprocess from a python script I cannot access the console output of util.print. Changing it to stderr.write works fine.

  2. process.stdout.flush() (line 187) results in an error on widows. commenting it out works fine. maybe you could find a way to make that work on all systems

Thank you for this very useful script!

Cheers
Georg

Error output seems to be truncated

jslint-reporter seems to truncate output to the last 10 errors, whatever the option is for jslint.

The problem seems to be with the util.print function in wrapper.js.

Replacing

util.print(errors.join("\n") + "\n");

with
for(i=0;i<errors.length;++i) {
util.print(errors[i]);
util.print("\n");
}

seems to solve the problem.

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.