From: Joe Wreschnig Date: Mon, 19 May 2014 12:34:19 +0000 (+0200) Subject: Custom jshint configuration. X-Git-Tag: 1.0.0~3 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=c66da5a020f5a229bc944b08e682636d1b3ecb98;p=string-lerp.git Custom jshint configuration. --- diff --git a/Makefile b/Makefile index c20843c..22b272f 100644 --- 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) diff --git a/string-lerp.js b/string-lerp.js index 989ceec..e25abfe 100644 --- a/string-lerp.js +++ b/string-lerp.js @@ -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 index 0000000..1cc8688 --- /dev/null +++ b/tests/jshint.config @@ -0,0 +1,10 @@ +{ + "camelcase": true, + "eqeqeq": true, + "indent": 4, + "latedef": true, + "nonew": true, + "trailing": true, + "undef": true, + "unused": "strict" +} diff --git a/tests/string-lerp.js b/tests/string-lerp.js index 04fc444..535f1f7 100644 --- a/tests/string-lerp.js +++ b/tests/string-lerp.js @@ -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');