Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jscs

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscs - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

lib/rules/require-spaces-inside-object-brackets.js

9

lib/checker.js

@@ -36,2 +36,3 @@ var esprima = require('esprima');

this.registerRule(new (require('./rules/disallow-yoda-conditions'))());
this.registerRule(new (require('./rules/require-spaces-inside-object-brackets'))());
},

@@ -115,4 +116,8 @@ configure: function(config) {

} else {
return _this.checkFile(path).then(function(errors) {
return [errors];
return Vow.when(_this.checkFile(path)).then(function(errors) {
if (errors) {
return [errors];
} else {
return [];
}
});

@@ -119,0 +124,0 @@ }

@@ -8,4 +8,10 @@ var assert = require('assert');

configure: function(disallowMultipleVarDecl) {
assert(typeof disallowMultipleVarDecl === 'boolean', 'disallow_multiple_var_decl option requires boolean value');
assert(disallowMultipleVarDecl === true, 'disallow_multiple_var_decl option requires true value or should be removed');
assert(
typeof disallowMultipleVarDecl === 'boolean',
'disallow_multiple_var_decl option requires boolean value'
);
assert(
disallowMultipleVarDecl === true,
'disallow_multiple_var_decl option requires true value or should be removed'
);
},

@@ -20,3 +26,3 @@

if (node.declarations.length > 1) {
errors.add('Multiple var declaration', node.loc.start.line, node.loc.start.column);
errors.add('Multiple var declaration', node.loc.start);
}

@@ -23,0 +29,0 @@ });

@@ -8,4 +8,10 @@ var assert = require('assert');

configure: function(disallowYodaConditions) {
assert(typeof disallowYodaConditions === 'boolean', 'disallow_multiple_var_decl option requires boolean value');
assert(disallowYodaConditions === true, 'disallow_multiple_var_decl option requires true value or should be removed');
assert(
typeof disallowYodaConditions === 'boolean',
'disallow_multiple_var_decl option requires boolean value'
);
assert(
disallowYodaConditions === true,
'disallow_multiple_var_decl option requires true value or should be removed'
);
this._operatorIndex = {

@@ -31,3 +37,5 @@ '==': true,

if (operators[node.operator]) {
if (node.left.type === 'Literal' || (node.left.type === 'Identifier' && node.left.name === 'undefined')) {
if (node.left.type === 'Literal' ||
(node.left.type === 'Identifier' && node.left.name === 'undefined')
) {
errors.add('Yoda condition', node.left.loc.start);

@@ -34,0 +42,0 @@ }

@@ -7,4 +7,10 @@ var assert = require('assert');

configure: function(requireMultipleVarDecl) {
assert(typeof requireMultipleVarDecl === 'boolean', 'require_multiple_var_decl option requires boolean value');
assert(requireMultipleVarDecl === true, 'require_multiple_var_decl option requires true value or should be removed');
assert(
typeof requireMultipleVarDecl === 'boolean',
'require_multiple_var_decl option requires boolean value'
);
assert(
requireMultipleVarDecl === true,
'require_multiple_var_decl option requires true value or should be removed'
);
},

@@ -18,15 +24,10 @@

file.iterateNodesByType('VariableDeclaration', function (node) {
if (node.parentCollection) {
for (var i = 0, l = node.parentCollection.length; i < l; i++) {
var sibling = node.parentCollection[i];
if (sibling === node && (i < l - 1)) {
sibling = node.parentCollection[i + 1];
if (sibling.type === 'VariableDeclaration') {
errors.add(
'Var declarations should be joined',
sibling.loc.start.line,
sibling.loc.start.column);
}
break;
}
var pos = node.parentCollection.indexOf(node);
if (pos < node.parentCollection.length - 1) {
var sibling = node.parentCollection[pos + 1];
if (sibling.type === 'VariableDeclaration') {
errors.add(
'Var declarations should be joined',
sibling.loc.start
);
}

@@ -33,0 +34,0 @@ }

@@ -5,3 +5,3 @@ {

"name" : "jscs",
"version" : "0.0.5",
"version" : "0.0.6",
"repository" : "https://github.com/mdevils/jscs",

@@ -8,0 +8,0 @@ "contributors" : [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc