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 c20843c..22b272f 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 989ceec..e25abfe 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 04fc444..535f1f7 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');