]> khamidou — GitHub mirrors - arcanist.git/commit
Adds ArcanistJSHintLinter to check JS files for errors and potential problems.
authorAnton Kovalyov <anton@kovalyov.net>
Fri, 13 Jan 2012 23:21:57 +0000 (15:21 -0800)
committerepriestley <git@epriestley.com>
Sat, 14 Jan 2012 03:17:34 +0000 (19:17 -0800)
commite5bda0520060ee73f590132adb1f0ffa30fcbc66
tree4edecb8276678964a6be3181dc41f67d89373ff7
parentf271e1d8e8856a450b6dfcec89ef0a33c5ab4aae
Adds ArcanistJSHintLinter to check JS files for errors and potential problems.

This patch adds ArcanistJSHintLinter class and three new .arcconfig options:

 * lint.jshint.prefix - directory where JSHint binary resides
 * lint.jshint.bin - JSHint binary name (if different from 'jshint')
 * lint.jshint.config - a JSON file with JSHint project-wide options

By default, this linter assumes that JSHint is installed on user's system
as an NPM package.

Test Plan:

(1)

Run `npm install jshint -g` to install JSHint and add
ArcanistJSHintLinter to your Lint Engine (I didn't see PEP8 or
PyFlakes in the PhutilLintEngine so I decided to not to put
JSHint in there). After that you can do `arc lint my.js`.

(2)

Create a new file, config.json, and add `{ "white": true }` in it.
Add `"lint.jshint.config": "/path/to/config.json"` to your .arcconfig and
run `arc lint my.js`. After that, unless your name is Douglas Crockford,
you'll see tons of JSHint warnings about minor PEP8-like things (spacing, etc.)
src/__phutil_library_map__.php
src/lint/linter/jshint/ArcanistJSHintLinter.php [new file with mode: 0644]
src/lint/linter/jshint/__init__.php [new file with mode: 0644]
src/lint/linter/jshint/reporter.js [new file with mode: 0644]