Project

jslintrb

0.0
No commit activity in last 3 years
No release in over 3 years
jslintrb is a packaged version of Douglas Crockford's JSLint JavaScript code checker. jslintrb uses SpiderMonkey via the Johnson Ruby gem to interpret the JSLint javascript.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.5.0
>= 2.5.0

Runtime

>= 2.0.0.pre0
 Project Readme

jslintrb¶ ↑

Description¶ ↑

jslintrb is a packaged version of Douglas Crockford’s JSLint JavaScript code checker. jslintrb uses SpiderMonkey via the Johnson Ruby gem to interpret the JSLint javascript.

Usage¶ ↑

jslintrb <javascript files to be checked>

You can provide .jslinrbrc files in the directory from which the command is run, the directory in which any file is found, and in any parent of that directory, to set jslint options. They are processed default first, then current directory, then ancestor directories, then the immediate parent. For example, I have a .jslintrbrc file in my top-level project directory that sets options for my project, then one in my spec directory (like a test directory) which adds the globals that exist for the tests but not for the core application code.

The file is JSON-formatted. See the jslint documentation (www.jslint.com/lint.html#options) for allowed options and an example at github.com/smparkes/env-js/blob/envjsrb/.jslintrbrc.

Differences from upstream¶ ↑

JSLint warns against using new to be evaluated soley for side-effects. jslintrb allows this if you set the “newside” option.

JSLint forbids the use void(x). I find this the cleanest/most reliable way of generating the undefined value, since the “undefined” variable can be defined. The “void” option enables the use of void.

Upstream recently added support for ECMAScript 5 getters and setters but this hasn’t been integrated yet. (Not sure about the requirements for paired getters/setters.) Nick Galbreath (blog.client9.com/) had the idea of just using a regexp to mangle the common cases for the purposes of jslint until upstream suports them. You can do this now in jslintrb by setting the “gettersetter” option to true. Note that this option has to be turned on in a .jslintrbrc file; it can’t be turned on with inline comments.

jslintrb copyright © 2010 Steven Parkes. See LICENSE for details. jslint copyright © 2002 Douglas Crockford. See lib/jslintrb/fulljslint.js for details.