From 15043ef9c69b9d94c8ac99bc4686759a33d3c40c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 12 Nov 2013 13:51:57 +0200 Subject: [PATCH 1/3] Enable JSHint's `eqeqeq` rule and remove `eqnull`. --- .jshintrc | 2 +- demos/CSSLintDemo.htm | 2 +- src/cli/node.js | 2 +- src/cli/wsh.js | 2 +- src/core/Reporter.js | 2 +- src/formatters/text.js | 2 +- src/rules/adjoining-classes.js | 4 ++-- src/rules/box-model.js | 8 ++++---- src/rules/box-sizing.js | 2 +- src/rules/compatible-vendor-prefixes.js | 4 ++-- src/rules/display-property-grouping.js | 2 +- src/rules/duplicate-background-images.js | 2 +- src/rules/duplicate-properties.js | 2 +- src/rules/fallback-colors.js | 4 ++-- src/rules/floats.js | 4 ++-- src/rules/font-sizes.js | 2 +- src/rules/ids.js | 6 +++--- src/rules/outline-none.js | 6 +++--- src/rules/overqualified-elements.js | 8 ++++---- src/rules/qualified-headings.js | 2 +- src/rules/regex-selectors.js | 4 ++-- src/rules/shorthand.js | 2 +- src/rules/star-property-hack.js | 2 +- src/rules/text-indent.js | 6 +++--- src/rules/underscore-property-hack.js | 2 +- src/rules/unique-headings.js | 2 +- src/rules/universal-selector.js | 2 +- src/rules/unqualified-attributes.js | 4 ++-- src/rules/vendor-prefix.js | 2 +- src/rules/zero-units.js | 2 +- 30 files changed, 48 insertions(+), 48 deletions(-) diff --git a/.jshintrc b/.jshintrc index 96e43ec6..21f87d53 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,7 +1,7 @@ { "camelcase": true, "curly": true, - "eqnull": true, + "eqeqeq": true, "forin": true, "immed": true, "indent": 4, diff --git a/demos/CSSLintDemo.htm b/demos/CSSLintDemo.htm index 3e60ea0b..6a7b6a4b 100644 --- a/demos/CSSLintDemo.htm +++ b/demos/CSSLintDemo.htm @@ -85,7 +85,7 @@

CSSLint Demo

results, messages, i, len; - if (target.id == "lint-btn") { + if (target.id === "lint-btn") { document.getElementById("output").innerHTML = ""; results = CSSLint.verify(document.getElementById("input").value); messages = results.messages; diff --git a/src/cli/node.js b/src/cli/node.js index caa1faf8..b09376f2 100644 --- a/src/cli/node.js +++ b/src/cli/node.js @@ -44,7 +44,7 @@ cli({ var path = stack.concat([file]).join("/"), stat = fs.statSync(path); - if (file[0] == ".") { + if (file[0] === ".") { return; } else if (stat.isFile() && /\.css$/.test(file)){ files.push(path); diff --git a/src/cli/wsh.js b/src/cli/wsh.js index d961c0e9..04f62334 100644 --- a/src/cli/wsh.js +++ b/src/cli/wsh.js @@ -22,7 +22,7 @@ var wshapi = (function(){ if (typeof Array.prototype.filter !== "function") { Array.prototype.filter = function(fn /*, thisp*/) { - if (typeof fn != "function") { + if (typeof fn !== "function") { throw new Error("not a function"); } var res = [], val, thisp = finalArgs[1]; diff --git a/src/core/Reporter.js b/src/core/Reporter.js index 71200563..374d0308 100644 --- a/src/core/Reporter.js +++ b/src/core/Reporter.js @@ -87,7 +87,7 @@ Reporter.prototype = { */ report: function(message, line, col, rule){ this.messages.push({ - type : this.ruleset[rule.id] == 2 ? "error" : "warning", + type : this.ruleset[rule.id] === 2 ? "error" : "warning", line : line, col : col, message : message, diff --git a/src/formatters/text.js b/src/formatters/text.js index d0669f86..04f01f7f 100644 --- a/src/formatters/text.js +++ b/src/formatters/text.js @@ -36,7 +36,7 @@ CSSLint.addFormatter({ } output = "\n\ncsslint: There "; - if (messages.length == 1) { + if (messages.length === 1) { output += "is 1 problem"; } else { output += "are " + messages.length + " problems"; diff --git a/src/rules/adjoining-classes.js b/src/rules/adjoining-classes.js index f23094c9..b6aeb297 100644 --- a/src/rules/adjoining-classes.js +++ b/src/rules/adjoining-classes.js @@ -25,11 +25,11 @@ CSSLint.addRule({ selector = selectors[i]; for (j=0; j < selector.parts.length; j++){ part = selector.parts[j]; - if (part.type == parser.SELECTOR_PART_TYPE){ + if (part.type === parser.SELECTOR_PART_TYPE){ classCount = 0; for (k=0; k < part.modifiers.length; k++){ modifier = part.modifiers[k]; - if (modifier.type == "class"){ + if (modifier.type === "class"){ classCount++; } if (classCount > 1){ diff --git a/src/rules/box-model.js b/src/rules/box-model.js index dcd57571..8f363b6c 100644 --- a/src/rules/box-model.js +++ b/src/rules/box-model.js @@ -45,7 +45,7 @@ CSSLint.addRule({ if (heightProperties.hasOwnProperty(prop) && properties[prop]){ value = properties[prop].value; //special case for padding - if (!(prop == "padding" && value.parts.length === 2 && value.parts[0].value === 0)){ + if (!(prop === "padding" && value.parts.length === 2 && value.parts[0].value === 0)){ reporter.report("Using height with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule); } } @@ -57,7 +57,7 @@ CSSLint.addRule({ if (widthProperties.hasOwnProperty(prop) && properties[prop]){ value = properties[prop].value; - if (!(prop == "padding" && value.parts.length === 2 && value.parts[1].value === 0)){ + if (!(prop === "padding" && value.parts.length === 2 && value.parts[1].value === 0)){ reporter.report("Using width with " + prop + " can sometimes make elements larger than you expect.", properties[prop].line, properties[prop].col, rule); } } @@ -76,13 +76,13 @@ CSSLint.addRule({ var name = event.property.text.toLowerCase(); if (heightProperties[name] || widthProperties[name]){ - if (!/^0\S*$/.test(event.value) && !(name == "border" && event.value == "none")){ + if (!/^0\S*$/.test(event.value) && !(name === "border" && event.value === "none")){ properties[name] = { line: event.property.line, col: event.property.col, value: event.value }; } } else { if (/^(width|height)/i.test(name) && /^(length|percentage)/.test(event.value.parts[0].type)){ properties[name] = 1; - } else if (name == "box-sizing") { + } else if (name === "box-sizing") { boxSizing = true; } } diff --git a/src/rules/box-sizing.js b/src/rules/box-sizing.js index ee7e7a07..f268396d 100644 --- a/src/rules/box-sizing.js +++ b/src/rules/box-sizing.js @@ -18,7 +18,7 @@ CSSLint.addRule({ parser.addListener("property", function(event){ var name = event.property.text.toLowerCase(); - if (name == "box-sizing"){ + if (name === "box-sizing"){ reporter.report("The box-sizing property isn't supported in IE6 and IE7.", event.line, event.col, rule); } }); diff --git a/src/rules/compatible-vendor-prefixes.js b/src/rules/compatible-vendor-prefixes.js index d8408d46..ccb45b8d 100644 --- a/src/rules/compatible-vendor-prefixes.js +++ b/src/rules/compatible-vendor-prefixes.js @@ -116,7 +116,7 @@ CSSLint.addRule({ if (CSSLint.Util.indexOf(applyTo, name.text) > -1) { // e.g., -moz-transform is okay to be alone in @-moz-keyframes - if (!inKeyFrame || typeof inKeyFrame != "string" || + if (!inKeyFrame || typeof inKeyFrame !== "string" || name.text.indexOf("-" + inKeyFrame + "-") !== 0) { properties.push(name); } @@ -173,7 +173,7 @@ CSSLint.addRule({ for (i = 0, len = full.length; i < len; i++) { item = full[i]; if (CSSLint.Util.indexOf(actual, item) === -1) { - propertiesSpecified = (actual.length === 1) ? actual[0] : (actual.length == 2) ? actual.join(" and ") : actual.join(", "); + propertiesSpecified = (actual.length === 1) ? actual[0] : (actual.length === 2) ? actual.join(" and ") : actual.join(", "); reporter.report("The property " + item + " is compatible with " + propertiesSpecified + " and should be included as well.", value.actualNodes[0].line, value.actualNodes[0].col, rule); } } diff --git a/src/rules/display-property-grouping.js b/src/rules/display-property-grouping.js index 15d48d1e..b3f5ca14 100644 --- a/src/rules/display-property-grouping.js +++ b/src/rules/display-property-grouping.js @@ -39,7 +39,7 @@ CSSLint.addRule({ function reportProperty(name, display, msg){ if (properties[name]){ - if (typeof propertiesToCheck[name] != "string" || properties[name].value.toLowerCase() != propertiesToCheck[name]){ + if (typeof propertiesToCheck[name] !== "string" || properties[name].value.toLowerCase() !== propertiesToCheck[name]){ reporter.report(msg || name + " can't be used with display: " + display + ".", properties[name].line, properties[name].col, rule); } } diff --git a/src/rules/duplicate-background-images.js b/src/rules/duplicate-background-images.js index a9fee588..28a75289 100644 --- a/src/rules/duplicate-background-images.js +++ b/src/rules/duplicate-background-images.js @@ -22,7 +22,7 @@ CSSLint.addRule({ if (name.match(/background/i)) { for (i=0, len=value.parts.length; i < len; i++) { - if (value.parts[i].type == "uri") { + if (value.parts[i].type === "uri") { if (typeof stack[value.parts[i].uri] === "undefined") { stack[value.parts[i].uri] = event; } diff --git a/src/rules/duplicate-properties.js b/src/rules/duplicate-properties.js index 1333d3f1..8653d0ab 100644 --- a/src/rules/duplicate-properties.js +++ b/src/rules/duplicate-properties.js @@ -31,7 +31,7 @@ CSSLint.addRule({ var property = event.property, name = property.text.toLowerCase(); - if (properties[name] && (lastProperty != name || properties[name] == event.value.text)){ + if (properties[name] && (lastProperty !== name || properties[name] === event.value.text)){ reporter.report("Duplicate property '" + event.property + "' found.", event.line, event.col, rule); } diff --git a/src/rules/fallback-colors.js b/src/rules/fallback-colors.js index 79f3b74e..77fe4dbe 100644 --- a/src/rules/fallback-colors.js +++ b/src/rules/fallback-colors.js @@ -48,14 +48,14 @@ CSSLint.addRule({ if(propertiesToCheck[name]){ while(i < len){ - if (parts[i].type == "color"){ + if (parts[i].type === "color"){ if ("alpha" in parts[i] || "hue" in parts[i]){ if (/([^\)]+)\(/.test(parts[i])){ colorType = RegExp.$1.toUpperCase(); } - if (!lastProperty || (lastProperty.property.text.toLowerCase() != name || lastProperty.colorType != "compat")){ + if (!lastProperty || (lastProperty.property.text.toLowerCase() !== name || lastProperty.colorType !== "compat")){ reporter.report("Fallback " + name + " (hex or RGB) should precede " + colorType + " " + name + ".", event.line, event.col, rule); } } else { diff --git a/src/rules/floats.js b/src/rules/floats.js index 5dbfb99f..7fc5e529 100644 --- a/src/rules/floats.js +++ b/src/rules/floats.js @@ -18,8 +18,8 @@ CSSLint.addRule({ //count how many times "float" is used parser.addListener("property", function(event){ - if (event.property.text.toLowerCase() == "float" && - event.value.text.toLowerCase() != "none"){ + if (event.property.text.toLowerCase() === "float" && + event.value.text.toLowerCase() !== "none"){ count++; } }); diff --git a/src/rules/font-sizes.js b/src/rules/font-sizes.js index 20f96ceb..d98c5701 100644 --- a/src/rules/font-sizes.js +++ b/src/rules/font-sizes.js @@ -17,7 +17,7 @@ CSSLint.addRule({ //check for use of "font-size" parser.addListener("property", function(event){ - if (event.property == "font-size"){ + if (event.property === "font-size"){ count++; } }); diff --git a/src/rules/ids.js b/src/rules/ids.js index 04c877bc..a7e01b1a 100644 --- a/src/rules/ids.js +++ b/src/rules/ids.js @@ -27,17 +27,17 @@ CSSLint.addRule({ for (j=0; j < selector.parts.length; j++){ part = selector.parts[j]; - if (part.type == parser.SELECTOR_PART_TYPE){ + if (part.type === parser.SELECTOR_PART_TYPE){ for (k=0; k < part.modifiers.length; k++){ modifier = part.modifiers[k]; - if (modifier.type == "id"){ + if (modifier.type === "id"){ idCount++; } } } } - if (idCount == 1){ + if (idCount === 1){ reporter.report("Don't use IDs in selectors.", selector.line, selector.col, rule); } else if (idCount > 1){ reporter.report(idCount + " IDs in the selector, really?", selector.line, selector.col, rule); diff --git a/src/rules/outline-none.js b/src/rules/outline-none.js index 7953a3d5..b92dbb7c 100644 --- a/src/rules/outline-none.js +++ b/src/rules/outline-none.js @@ -34,9 +34,9 @@ CSSLint.addRule({ function endRule(){ if (lastRule){ if (lastRule.outline){ - if (lastRule.selectors.toString().toLowerCase().indexOf(":focus") == -1){ + if (lastRule.selectors.toString().toLowerCase().indexOf(":focus") === -1){ reporter.report("Outlines should only be modified using :focus.", lastRule.line, lastRule.col, rule); - } else if (lastRule.propCount == 1) { + } else if (lastRule.propCount === 1) { reporter.report("Outlines shouldn't be hidden unless other visual changes are made.", lastRule.line, lastRule.col, rule); } } @@ -55,7 +55,7 @@ CSSLint.addRule({ if (lastRule){ lastRule.propCount++; - if (name == "outline" && (value == "none" || value == "0")){ + if (name === "outline" && (value === "none" || value === "0")){ lastRule.outline = true; } } diff --git a/src/rules/overqualified-elements.js b/src/rules/overqualified-elements.js index cceb8830..908da517 100644 --- a/src/rules/overqualified-elements.js +++ b/src/rules/overqualified-elements.js @@ -27,12 +27,12 @@ CSSLint.addRule({ for (j=0; j < selector.parts.length; j++){ part = selector.parts[j]; - if (part.type == parser.SELECTOR_PART_TYPE){ + if (part.type === parser.SELECTOR_PART_TYPE){ for (k=0; k < part.modifiers.length; k++){ modifier = part.modifiers[k]; - if (part.elementName && modifier.type == "id"){ + if (part.elementName && modifier.type === "id"){ reporter.report("Element (" + part + ") is overqualified, just use " + modifier + " without element name.", part.line, part.col, rule); - } else if (modifier.type == "class"){ + } else if (modifier.type === "class"){ if (!classes[modifier]){ classes[modifier] = []; @@ -52,7 +52,7 @@ CSSLint.addRule({ if (classes.hasOwnProperty(prop)){ //one use means that this is overqualified - if (classes[prop].length == 1 && classes[prop][0].part.elementName){ + if (classes[prop].length === 1 && classes[prop][0].part.elementName){ reporter.report("Element (" + classes[prop][0].part + ") is overqualified, just use " + classes[prop][0].modifier + " without element name.", classes[prop][0].part.line, classes[prop][0].part.col, rule); } } diff --git a/src/rules/qualified-headings.js b/src/rules/qualified-headings.js index 5000fdac..f6f2052f 100644 --- a/src/rules/qualified-headings.js +++ b/src/rules/qualified-headings.js @@ -25,7 +25,7 @@ CSSLint.addRule({ for (j=0; j < selector.parts.length; j++){ part = selector.parts[j]; - if (part.type == parser.SELECTOR_PART_TYPE){ + if (part.type === parser.SELECTOR_PART_TYPE){ if (part.elementName && /h[1-6]/.test(part.elementName.toString()) && j > 0){ reporter.report("Heading (" + part.elementName + ") should not be qualified.", part.line, part.col, rule); } diff --git a/src/rules/regex-selectors.js b/src/rules/regex-selectors.js index 030f88e1..b81bf184 100644 --- a/src/rules/regex-selectors.js +++ b/src/rules/regex-selectors.js @@ -25,10 +25,10 @@ CSSLint.addRule({ selector = selectors[i]; for (j=0; j < selector.parts.length; j++){ part = selector.parts[j]; - if (part.type == parser.SELECTOR_PART_TYPE){ + if (part.type === parser.SELECTOR_PART_TYPE){ for (k=0; k < part.modifiers.length; k++){ modifier = part.modifiers[k]; - if (modifier.type == "attribute"){ + if (modifier.type === "attribute"){ if (/([\~\|\^\$\*]=)/.test(modifier)){ reporter.report("Attribute selectors with " + RegExp.$1 + " are slow!", modifier.line, modifier.col, rule); } diff --git a/src/rules/shorthand.js b/src/rules/shorthand.js index 85bbda26..f0df4e37 100644 --- a/src/rules/shorthand.js +++ b/src/rules/shorthand.js @@ -59,7 +59,7 @@ CSSLint.addRule({ total += properties[mapping[prop][i]] ? 1 : 0; } - if (total == mapping[prop].length){ + if (total === mapping[prop].length){ reporter.report("The properties " + mapping[prop].join(", ") + " can be replaced by " + prop + ".", event.line, event.col, rule); } } diff --git a/src/rules/star-property-hack.js b/src/rules/star-property-hack.js index 7f4f91b3..c0478a95 100644 --- a/src/rules/star-property-hack.js +++ b/src/rules/star-property-hack.js @@ -19,7 +19,7 @@ CSSLint.addRule({ parser.addListener("property", function(event){ var property = event.property; - if (property.hack == "*") { + if (property.hack === "*") { reporter.report("Property with star prefix found.", event.property.line, event.property.col, rule); } }); diff --git a/src/rules/text-indent.js b/src/rules/text-indent.js index 01c970f9..eff32877 100644 --- a/src/rules/text-indent.js +++ b/src/rules/text-indent.js @@ -25,7 +25,7 @@ CSSLint.addRule({ //event handler for end of rules function endRule(){ - if (textIndent && direction != "ltr"){ + if (textIndent && direction !== "ltr"){ reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", textIndent.line, textIndent.col, rule); } } @@ -38,9 +38,9 @@ CSSLint.addRule({ var name = event.property.toString().toLowerCase(), value = event.value; - if (name == "text-indent" && value.parts[0].value < -99){ + if (name === "text-indent" && value.parts[0].value < -99){ textIndent = event.property; - } else if (name == "direction" && value == "ltr"){ + } else if (name === "direction" && value === "ltr"){ direction = "ltr"; } }); diff --git a/src/rules/underscore-property-hack.js b/src/rules/underscore-property-hack.js index 0da1747c..403e4ee7 100644 --- a/src/rules/underscore-property-hack.js +++ b/src/rules/underscore-property-hack.js @@ -19,7 +19,7 @@ CSSLint.addRule({ parser.addListener("property", function(event){ var property = event.property; - if (property.hack == "_") { + if (property.hack === "_") { reporter.report("Property with underscore prefix found.", event.property.line, event.property.col, rule); } }); diff --git a/src/rules/unique-headings.js b/src/rules/unique-headings.js index 22de7495..7a1b5845 100644 --- a/src/rules/unique-headings.js +++ b/src/rules/unique-headings.js @@ -37,7 +37,7 @@ CSSLint.addRule({ if (part.elementName && /(h[1-6])/i.test(part.elementName.toString())){ for (j=0; j < part.modifiers.length; j++){ - if (part.modifiers[j].type == "pseudo"){ + if (part.modifiers[j].type === "pseudo"){ pseudo = true; break; } diff --git a/src/rules/universal-selector.js b/src/rules/universal-selector.js index 79088986..e2f3fb4a 100644 --- a/src/rules/universal-selector.js +++ b/src/rules/universal-selector.js @@ -24,7 +24,7 @@ CSSLint.addRule({ selector = selectors[i]; part = selector.parts[selector.parts.length-1]; - if (part.elementName == "*"){ + if (part.elementName === "*"){ reporter.report(rule.desc, part.line, part.col, rule); } } diff --git a/src/rules/unqualified-attributes.js b/src/rules/unqualified-attributes.js index 110fa15e..eb531581 100644 --- a/src/rules/unqualified-attributes.js +++ b/src/rules/unqualified-attributes.js @@ -26,10 +26,10 @@ CSSLint.addRule({ selector = selectors[i]; part = selector.parts[selector.parts.length-1]; - if (part.type == parser.SELECTOR_PART_TYPE){ + if (part.type === parser.SELECTOR_PART_TYPE){ for (k=0; k < part.modifiers.length; k++){ modifier = part.modifiers[k]; - if (modifier.type == "attribute" && (!part.elementName || part.elementName == "*")){ + if (modifier.type === "attribute" && (!part.elementName || part.elementName === "*")){ reporter.report(rule.desc, part.line, part.col, rule); } } diff --git a/src/rules/vendor-prefix.js b/src/rules/vendor-prefix.js index d9b249ac..795893e6 100644 --- a/src/rules/vendor-prefix.js +++ b/src/rules/vendor-prefix.js @@ -79,7 +79,7 @@ CSSLint.addRule({ //event handler for beginning of rules function startRule(){ properties = {}; - num=1; + num = 1; } //event handler for end of rules diff --git a/src/rules/zero-units.js b/src/rules/zero-units.js index 08886ee8..0e5a1d65 100644 --- a/src/rules/zero-units.js +++ b/src/rules/zero-units.js @@ -21,7 +21,7 @@ CSSLint.addRule({ len = parts.length; while(i < len){ - if ((parts[i].units || parts[i].type == "percentage") && parts[i].value === 0 && parts[i].type != "time"){ + if ((parts[i].units || parts[i].type === "percentage") && parts[i].value === 0 && parts[i].type !== "time"){ reporter.report("Values of 0 shouldn't have units specified.", parts[i].line, parts[i].col, rule); } i++; From 45bf071f7c7e09cc86e48e9a36d2a33754ae4b9f Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 3 Apr 2014 09:38:32 +0300 Subject: [PATCH 2/3] Enable strict mode. --- .jshintrc | 3 ++- Gruntfile.js | 2 ++ demos/CSSLintDemo.htm | 1 + src/cli/common.js | 1 + src/cli/node.js | 7 +++++++ src/cli/rhino.js | 6 ++++++ src/cli/wsh.js | 3 ++- src/core/CSSLint.js | 1 + src/core/Reporter.js | 8 ++++++++ src/core/Util.js | 3 +++ src/formatters/checkstyle-xml.js | 1 + src/formatters/compact.js | 5 ++++- src/formatters/csslint-xml.js | 3 +++ src/formatters/junit-xml.js | 3 +++ src/formatters/lint-xml.js | 3 +++ src/formatters/text.js | 3 +++ src/rules/adjoining-classes.js | 1 + src/rules/box-model.js | 1 + src/rules/box-sizing.js | 1 + src/rules/bulletproof-font-face.js | 1 + src/rules/compatible-vendor-prefixes.js | 1 + src/rules/display-property-grouping.js | 1 + src/rules/duplicate-background-images.js | 1 + src/rules/duplicate-properties.js | 1 + src/rules/empty-rules.js | 1 + src/rules/errors.js | 1 + src/rules/fallback-colors.js | 1 + src/rules/floats.js | 1 + src/rules/font-faces.js | 1 + src/rules/font-sizes.js | 1 + src/rules/gradients.js | 1 + src/rules/ids.js | 1 + src/rules/import.js | 1 + src/rules/important.js | 1 + src/rules/known-properties.js | 1 + src/rules/order-alphabetical.js | 1 + src/rules/outline-none.js | 1 + src/rules/overqualified-elements.js | 1 + src/rules/qualified-headings.js | 1 + src/rules/regex-selectors.js | 1 + src/rules/rules-count.js | 1 + src/rules/selector-max-approaching.js | 1 + src/rules/selector-max.js | 1 + src/rules/selector-newline.js | 1 + src/rules/shorthand.js | 1 + src/rules/star-property-hack.js | 1 + src/rules/text-indent.js | 1 + src/rules/underscore-property-hack.js | 1 + src/rules/unique-headings.js | 1 + src/rules/universal-selector.js | 1 + src/rules/unqualified-attributes.js | 1 + src/rules/vendor-prefix.js | 1 + src/rules/zero-units.js | 1 + src/worker/Worker.js | 2 +- tests/all-rules.js | 1 + tests/core/CSSLint.js | 1 + tests/core/Reporter.js | 1 + tests/formatters/checkstyle-xml.js | 1 + tests/formatters/compact.js | 1 + tests/formatters/csslint-xml.js | 1 + tests/formatters/junit-xml.js | 1 + tests/formatters/lint-xml.js | 1 + tests/formatters/text.js | 1 + tests/rules/adjoining-classes.js | 1 + tests/rules/box-model.js | 1 + tests/rules/box-sizing.js | 1 + tests/rules/bulletproof-font-face.js | 1 + tests/rules/compatible-vendor-prefixes.js | 1 + tests/rules/display-property-grouping.js | 1 + tests/rules/duplicate-background-images.js | 1 + tests/rules/duplicate-properties.js | 1 + tests/rules/empty-rules.js | 1 + tests/rules/errors.js | 1 + tests/rules/fallback-colors.js | 1 + tests/rules/floats.js | 1 + tests/rules/font-faces.js | 1 + tests/rules/font-sizes.js | 1 + tests/rules/gradients.js | 1 + tests/rules/ids.js | 1 + tests/rules/import.js | 1 + tests/rules/important.js | 1 + tests/rules/known-properties.js | 1 + tests/rules/order-alphabetical.js | 1 + tests/rules/outline-none.js | 1 + tests/rules/overqualified-elements.js | 1 + tests/rules/qualified-headings.js | 1 + tests/rules/regex-selectors.js | 1 + tests/rules/selector-max-approaching.js | 1 + tests/rules/selector-max.js | 1 + tests/rules/selector-newline.js | 2 +- tests/rules/shorthand.js | 1 + tests/rules/star-property-hack.js | 1 + tests/rules/text-indent.js | 1 + tests/rules/underscore-property-hack.js | 1 + tests/rules/unique-headings.js | 1 + tests/rules/universal-selector.js | 1 + tests/rules/unqualified-attributes.js | 1 + tests/rules/vendor-prefix.js | 1 + tests/rules/zero-units.js | 1 + tests/testrunner.htm | 1 + 100 files changed, 134 insertions(+), 5 deletions(-) diff --git a/.jshintrc b/.jshintrc index 21f87d53..4cf0db5e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -11,8 +11,9 @@ "noempty": true, "nonbsp": true, "quotmark": "double", - "unused": true, + "strict": true, "undef": true, + "unused": true, "globals": { "CSSLint": true, "YUITest": true diff --git a/Gruntfile.js b/Gruntfile.js index 3ecf8884..d8c264ba 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,7 @@ /* jshint camelcase:false, evil:true, node:true */ +"use strict"; + module.exports = function(grunt) { // Project configuration. diff --git a/demos/CSSLintDemo.htm b/demos/CSSLintDemo.htm index 6a7b6a4b..15a771b1 100644 --- a/demos/CSSLintDemo.htm +++ b/demos/CSSLintDemo.htm @@ -78,6 +78,7 @@

CSSLint Demo