jscs
Advanced tools
Comparing version 1.5.6 to 1.5.7
@@ -46,3 +46,3 @@ var vowFs = require('vow-fs'); | ||
if (!_this._isExcluded(path) && _this._hasCorrectExtension(path)) { | ||
if (!_this._isExcluded(path)) { | ||
return vowFs.read(path, 'utf8').then(function(data) { | ||
@@ -53,17 +53,6 @@ return _this.checkString(data, path); | ||
return null; | ||
}; | ||
var defer = Vow.defer(); | ||
defer.resolve(null); | ||
/** | ||
* Should replace Checker#checkFile method in 2.0 since it would be a breaking change | ||
* | ||
* @param {String} path | ||
* @returns {Promise * Errors} | ||
*/ | ||
Checker.prototype._checkFile = function(path) { | ||
var _this = this; | ||
return vowFs.read(path, 'utf8').then(function(data) { | ||
return _this.checkString(data, path); | ||
}); | ||
return defer.promise(); | ||
}; | ||
@@ -94,2 +83,6 @@ | ||
if (!_this._hasCorrectExtension(fullname)) { | ||
return []; | ||
} | ||
return Vow.when(_this.checkFile(fullname)).then(function(errors) { | ||
@@ -118,2 +111,3 @@ if (errors) { | ||
var _this = this; | ||
return vowFs.exists(path).then(function(exists) { | ||
@@ -129,3 +123,3 @@ if (!exists) { | ||
return _this._checkFile(path).then(function(errors) { | ||
return _this.checkFile(path).then(function(errors) { | ||
if (errors) { | ||
@@ -132,0 +126,0 @@ return [errors]; |
@@ -31,3 +31,3 @@ var assert = require('assert'); | ||
if (lines[startLine] === lines[closingLine]) { | ||
if (startLine === closingLine) { | ||
return; | ||
@@ -34,0 +34,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"name": "jscs", | ||
"version": "1.5.6", | ||
"version": "1.5.7", | ||
"main": "lib/checker", | ||
@@ -62,4 +62,5 @@ "homepage": "https://github.com/mdevils/node-jscs", | ||
"presets", | ||
"LICENSE" | ||
"LICENSE", | ||
"jscs-browser.js" | ||
] | ||
} |
@@ -18,6 +18,8 @@ { | ||
"switch", | ||
"case", | ||
"return", | ||
"try", | ||
"catch", | ||
"function" | ||
"function", | ||
"typeof" | ||
], | ||
@@ -24,0 +26,0 @@ "requireSpaceBeforeBlockStatements": true, |
@@ -33,3 +33,10 @@ { | ||
], | ||
"requireSpaceBeforeBinaryOperators": true, | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", | ||
"&=", "|=", "^=", | ||
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", | ||
"|", "^", "&&", "||", "===", "==", ">=", | ||
"<=", "<", ">", "!=", "!==" | ||
], | ||
"requireSpaceAfterBinaryOperators": true, | ||
@@ -36,0 +43,0 @@ |
@@ -2509,6 +2509,8 @@ # node-jscs [![Build Status](https://travis-ci.org/mdevils/node-jscs.svg?branch=master)](https://travis-ci.org/mdevils/node-jscs) [![Dependency Status](https://david-dm.org/mdevils/node-jscs.svg?theme=shields.io)](https://david-dm.org/mdevils/node-jscs) [![devDependency Status](https://david-dm.org/mdevils/node-jscs/dev-status.svg?theme=shields.io)](https://david-dm.org/mdevils/node-jscs#info=devDependencies) | ||
File [jscs-browser.js](jscs-browser.js) contains browser-compatible version of `jscs`. | ||
The npm package contains a file named `jscs-browser.js` (since version `1.5.7`), which is a browser compatible version of `jscs`. | ||
Download and include `jscs-browser.js` into your page. | ||
If you'd like to generate this file yourself, run `npm browserify` after cloning this repo. | ||
Use `jscs-browser.js` on your page as follows: | ||
```html | ||
@@ -2515,0 +2517,0 @@ <script src="jscs-browser.js"></script> |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
588925
101
14422
2527
15