summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-08-17 12:16:48 -0500
committerkpdecker <kpdecker@gmail.com>2013-08-17 12:16:48 -0500
commit6492fe8c2300d39d71d11cc6837cf2e63d238cd1 (patch)
treedcf87fd21b89d1ac01f5a62a9d199de005260455
parent3d77d172ecba90a09e4e66518b425ac17b35fe51 (diff)
downloadhandlebars.js-6492fe8c2300d39d71d11cc6837cf2e63d238cd1.zip
handlebars.js-6492fe8c2300d39d71d11cc6837cf2e63d238cd1.tar.gz
handlebars.js-6492fe8c2300d39d71d11cc6837cf2e63d238cd1.tar.bz2
Add jshint to grunt exec
-rw-r--r--.jshintrc1
-rw-r--r--Gruntfile.js11
-rw-r--r--dist/handlebars.js2
-rw-r--r--dist/handlebars.runtime.js2
-rw-r--r--lib/handlebars.js2
-rw-r--r--lib/handlebars/utils.js2
-rw-r--r--package.json1
7 files changed, 20 insertions, 1 deletions
diff --git a/.jshintrc b/.jshintrc
index d6bd57b..3a42ab1 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -29,7 +29,6 @@
],
"node" : true,
- "es5" : true,
"browser" : true,
"boss" : true,
diff --git a/Gruntfile.js b/Gruntfile.js
index 6d6f7ad..bfcc020 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,6 +2,16 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
+ jshint: {
+ options: {
+ jshintrc: '.jshintrc',
+ force: true
+ },
+ files: [
+ 'lib/**/!(parser|browser-prefix|browser-suffix).js'
+ ]
+ },
+
concat: {
options: {
banner: '/*!\n\n <%= pkg.name %> v<%= pkg.version %>\n\n<%= grunt.file.read("LICENSE") %>\n@license\n*/\n',
@@ -55,6 +65,7 @@ module.exports = function(grunt) {
});
grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('dist-dir', function() {
diff --git a/dist/handlebars.js b/dist/handlebars.js
index 2fba979..24f82aa 100644
--- a/dist/handlebars.js
+++ b/dist/handlebars.js
@@ -844,6 +844,8 @@ Handlebars.Utils = {
},
escapeExpression: function(string) {
+ /*jshint eqnull: true */
+
// don't escape SafeStrings, since they're already safe
if (string instanceof Handlebars.SafeString) {
return string.toString();
diff --git a/dist/handlebars.runtime.js b/dist/handlebars.runtime.js
index c87b9e3..02834f3 100644
--- a/dist/handlebars.runtime.js
+++ b/dist/handlebars.runtime.js
@@ -233,6 +233,8 @@ Handlebars.Utils = {
},
escapeExpression: function(string) {
+ /*jshint eqnull: true */
+
// don't escape SafeStrings, since they're already safe
if (string instanceof Handlebars.SafeString) {
return string.toString();
diff --git a/lib/handlebars.js b/lib/handlebars.js
index f82ec3b..c6130d1 100644
--- a/lib/handlebars.js
+++ b/lib/handlebars.js
@@ -1,3 +1,5 @@
+/*global Handlebars: true */
+
var handlebars = require("./handlebars/base"),
// Each of these augment the Handlebars object. No need to setup here.
diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js
index e104dcf..9a4ff77 100644
--- a/lib/handlebars/utils.js
+++ b/lib/handlebars/utils.js
@@ -50,6 +50,8 @@ Handlebars.Utils = {
},
escapeExpression: function(string) {
+ /*jshint eqnull: true */
+
// don't escape SafeStrings, since they're already safe
if (string instanceof Handlebars.SafeString) {
return string.toString();
diff --git a/package.json b/package.json
index b44054f..78691e4 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"dust": "~0.3",
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
+ "grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-uglify": "~0.2.2",
"jison": "~0.3",
"mocha": "*",