From c66da5a020f5a229bc944b08e682636d1b3ecb98 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Mon, 19 May 2014 14:34:19 +0200 Subject: [PATCH] Custom jshint configuration. --- Makefile | 4 +++- string-lerp.js | 1 + tests/jshint.config | 10 ++++++++++ tests/string-lerp.js | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/jshint.config 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'); -- 2.30.2