From 9895dd90b9950ff31a97b45f20225b4b3f995ac4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Thu, 6 Jun 2013 15:57:48 -0700 Subject: [PATCH] Add jshint config and lint script. --- jshint.json | 18 ++++++++++++++++++ package.json | 1 + scripts/lint.sh | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 jshint.json create mode 100755 scripts/lint.sh diff --git a/jshint.json b/jshint.json new file mode 100644 index 0000000..7ea055f --- /dev/null +++ b/jshint.json @@ -0,0 +1,18 @@ +{ + "maxerr" : 100, + "node" : true, + "curly" : true, + "eqeqeq" : true, + "latedef" : false, + "undef" : true, + "newcap" : true, + "nonew" : true, + "onevar" : false, + "trailing" : true, + "white" : false, + "sub" : true, + "evil" : true, + "es5" : true, + "onecase" : true, + "strict" : false +} diff --git a/package.json b/package.json index 2938c12..e420f8f 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "bin": "./bin" }, "scripts": { + "lint": "./scripts/lint.sh", "test": "make test" }, "dependencies": { diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 0000000..f4aa51b --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Copyright 2013 Tomaz Muraus +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +./node_modules/.bin/jshint $(find ./lib -type f -name "*.js" | grep -v lib/extern) --config jshint.json