Custom jshint configuration.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 19 May 2014 12:34:19 +0000 (14:34 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Mon, 19 May 2014 12:34:19 +0000 (14:34 +0200)
Makefile
string-lerp.js
tests/jshint.config [new file with mode: 0644]
tests/string-lerp.js

index c20843c966eee1ec2955cc009ee76773d5b88c38..22b272f653fc1913ce2f218573befcd451d56d94 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,8 @@ UGLIFY ?= $(call fallback,uglifyjs,$(NPMBINDIR)/uglifyjs)
 SOURCES := string-lerp.js
 UGLIFIED = $(SOURCES:.js=.min.js)
 
+JSHINTFLAGS += --config tests/jshint.config
+
 TESTS = $(wildcard tests/*.js)
 LINT_TARGETS = $(patsubst %.js,build/stamp/%.lint,$(SOURCES))
 TEST_TARGETS = $(patsubst %.js,build/stamp/%.test,$(SOURCES)) \
@@ -38,7 +40,7 @@ all:
 
 build/stamp/%.lint: %.js | $(JSHINT)
        @mkdir -p $(@D)
-       $(JSHINT) $<
+       $(JSHINT) $(JSHINTFLAGS) $<
        @touch $@
 
 build/stamp/%.test: tests/%.js %.js | $(JSTEST)
index 989ceec9d5d19261522b794eb86caf9d5a3e1e3f..e25abfe6d1ad2cf31a1eb08f62ac78b1066076af 100644 (file)
@@ -8,6 +8,7 @@
 */
 
 /* @license Copyright 2014 Joe Wreschnig - GNU GPL v2 or later */
+/*globals exports, Uint32Array */
 
 (function (exports) {
     "use strict";
diff --git a/tests/jshint.config b/tests/jshint.config
new file mode 100644 (file)
index 0000000..1cc8688
--- /dev/null
@@ -0,0 +1,10 @@
+{
+    "camelcase": true,
+    "eqeqeq": true,
+    "indent": 4,
+    "latedef": true,
+    "nonew": true,
+    "trailing": true,
+    "undef": true,
+    "unused": "strict"
+}
index 04fc4445eb3dc2b4dcfeac7a1b25e8bd9eebdf81..535f1f784bba2a2c81a4b9e515abcc0acc1ca986 100644 (file)
@@ -1,3 +1,6 @@
+/*global require, it, assert, assertEqual, assertNot */
+/*jshint -W085 */ // "Don't use 'with'."
+
 var JS = this.JS || require('jstest');
 var stringLerp = require('../string-lerp');