Comparing version 1.0.2 to 1.0.3
@@ -0,1 +1,4 @@ | ||
Version 1.0.3: | ||
* Changed behaviour for `disallowMultipleVarDecl` options. Now accepts multiple var decl in `for` decl. | ||
Version 1.0.2: | ||
@@ -2,0 +5,0 @@ * Option `requireSpacesInsideArrayBrackets` (@mishanga). |
@@ -24,3 +24,5 @@ var assert = require('assert'); | ||
file.iterateNodesByType('VariableDeclaration', function (node) { | ||
if (node.declarations.length > 1) { | ||
// allow multiple var declarations in for statement | ||
// for (var i = 0, j = myArray.length; i < j; i++) {} | ||
if (node.declarations.length > 1 && node.parentNode.type !== 'ForStatement') { | ||
errors.add('Multiple var declaration', node.loc.start); | ||
@@ -27,0 +29,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"name" : "jscs", | ||
"version" : "1.0.2", | ||
"version" : "1.0.3", | ||
"repository" : "https://github.com/mdevils/node-jscs", | ||
@@ -25,4 +25,4 @@ "contributors" : [ | ||
"esprima": "1.0.3", | ||
"vow": "0.3.7", | ||
"vow-fs": "0.1.13", | ||
"vow": "0.3.9", | ||
"vow-fs": "0.2.3", | ||
"colors": "0.6.0-1", | ||
@@ -29,0 +29,0 @@ "commander": "1.2.0", |
@@ -84,3 +84,3 @@ node-jscs [![Build Status](https://travis-ci.org/mdevils/node-jscs.png?branch=master)](https://travis-ci.org/mdevils/node-jscs) | ||
Option: disallowMultipleVarDecl | ||
Disallows multiple var declaration. | ||
Disallows multiple var declaration (except for-loop). | ||
@@ -92,2 +92,4 @@ Valid example: | ||
for (var i = 0, j = arr.length; i < j; i++) {} | ||
Invalid example: | ||
@@ -132,3 +134,3 @@ | ||
Option: disallowSpacesInsideArrayBrackets | ||
Disallows space after opening array square brace and before closing. | ||
Disallows space after opening array square bracket and before closing. | ||
@@ -167,3 +169,3 @@ Valid example: | ||
Possible values: "all" for strict mode, "allButNested" ignores closing brackets in a row. | ||
Requires space after opening array square brace and before closing. | ||
Requires space after opening array square bracket and before closing. | ||
@@ -170,0 +172,0 @@ Valid example for mode "all": |
@@ -22,2 +22,6 @@ var Checker = require('../lib/checker'); | ||
}); | ||
it('should not report multiple var decl in for statement', function() { | ||
checker.configure({ disallowMultipleVarDecl: true }); | ||
assert(checker.checkString('for (var i = 0, j = arr.length; i < j; i++) {}').isEmpty()); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
306505
2662
429
+ Addedvow@0.3.9(transitive)
+ Addedvow-fs@0.2.3(transitive)
+ Addedvow-queue@0.0.2(transitive)
- Removedvow@0.3.7(transitive)
- Removedvow-fs@0.1.13(transitive)
Updatedvow@0.3.9
Updatedvow-fs@0.2.3