From: XhmikosR Date: Sat, 8 Mar 2014 21:22:05 +0000 (+0200) Subject: Enable `strict` rule. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=d8156bed28be4cd6aea39b2391bdf46493e17390;p=html-minifier.git Enable `strict` rule. --- diff --git a/.jshintrc b/.jshintrc index 19da2b0..916b119 100644 --- a/.jshintrc +++ b/.jshintrc @@ -10,7 +10,7 @@ "newcap": true, "node": true, "quotmark": "single", - "strict": false, + "strict": true, "undef": true, "unused": true } diff --git a/master.js b/master.js index 6e372e9..2ac8845 100644 --- a/master.js +++ b/master.js @@ -1,5 +1,6 @@ /* global HTMLLint, minify */ (function(){ + 'use strict'; function byId(id) { return document.getElementById(id); diff --git a/src/htmllint.js b/src/htmllint.js index 8f13100..cbcf925 100644 --- a/src/htmllint.js +++ b/src/htmllint.js @@ -7,6 +7,7 @@ */ (function(global) { + 'use strict'; function isPresentationalElement(tag) { return (/^(?:b|i|big|small|hr|blink|marquee)$/).test(tag); diff --git a/src/htmlminifier.js b/src/htmlminifier.js index 1f0cee5..f8272bd 100644 --- a/src/htmlminifier.js +++ b/src/htmlminifier.js @@ -1,4 +1,5 @@ (function(global){ + 'use strict'; var log, HTMLParser; if (global.console && global.console.log) { diff --git a/src/htmlparser.js b/src/htmlparser.js index 06ed2d8..7814360 100644 --- a/src/htmlparser.js +++ b/src/htmlparser.js @@ -29,6 +29,7 @@ /* global ActiveXObject, DOMDocument */ (function(global){ + 'use strict'; // Regular Expressions for parsing tags and attributes var startTag = /^<([\w:-]+)((?:\s*[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, diff --git a/tests/lint.js b/tests/lint.js index e93ccbe..8588afc 100644 --- a/tests/lint.js +++ b/tests/lint.js @@ -1,5 +1,6 @@ /* global test, ok, equal */ (function(global){ + 'use strict'; var minify = global.minify || require('../dist/htmlminifier.js').minify, HTMLLint = HTMLLint || require('../dist/htmlminifier.js').HTMLLint, diff --git a/tests/minifier.js b/tests/minifier.js index 5062332..8e5343c 100644 --- a/tests/minifier.js +++ b/tests/minifier.js @@ -1,5 +1,6 @@ /* global test, ok, equal */ (function(global){ + 'use strict'; var minify = global.minify || require('../dist/htmlminifier.js').minify, input,