fnd / jslint-reporter Goto Github PK
View Code? Open in Web Editor NEWNode.js wrapper for JSLint
Node.js wrapper for JSLint
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>
see https://github.com/FND/jslint-reporter/compare/jshint - but needs an option to switch back and forth between the two
It would be simpler to use jslint-reporter the first time with the automatic download of jslint.js.
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.
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(":");
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).
Dear FND
I'm using the jslint-reporter with node.js on windows and ran into two problems.
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.