diff --git a/.jscsrc b/.jscsrc index a54fd6d2..07bd2255 100644 --- a/.jscsrc +++ b/.jscsrc @@ -4,6 +4,7 @@ "requireCapitalizedConstructors": false, "disallowTrailingWhitespace": "ignoreEmptyLines", "disallowTrailingComma": false, + "disallowUnusedVariables": true, "validateIndentation": false, "requireCurlyBraces": false, "requireSpacesInAnonymousFunctionExpression": { diff --git a/lib/client/dom.js b/lib/client/dom.js index dd9b62f7..592cbedb 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -796,7 +796,7 @@ var CloudCmd, Util, DOM, CloudFunc; * unified way to set current file */ this.setCurrentFile = function(currentFile, options) { - var ret, path, pathWas, title, + var path, pathWas, title, o = options, FS = CloudFunc.FS, CENTER = true, @@ -831,8 +831,6 @@ var CloudCmd, Util, DOM, CloudFunc; /* scrolling to current file */ this.scrollIntoViewIfNeeded(currentFile, CENTER); - ret = true; - Cmd.updateCurrentInfo(); } diff --git a/lib/client/load.js b/lib/client/load.js index 6582a240..d071aa76 100644 --- a/lib/client/load.js +++ b/lib/client/load.js @@ -246,7 +246,7 @@ emitter.emit('end'); } else { error = Error(xhr.responseText); - emitter.emit('error'); + emitter.emit('error', error); } }; diff --git a/lib/client/operation.js b/lib/client/operation.js index 2f0c5a7f..1c978f52 100644 --- a/lib/client/operation.js +++ b/lib/client/operation.js @@ -240,7 +240,7 @@ * @currentFile */ function promptDelete() { - var ret, type, isDir, msg, + var type, isDir, msg, name = '', msgAsk = 'Do you really want to delete the ', msgSel = 'selected ', @@ -278,8 +278,6 @@ Dialog.confirm(TITLE, msg, {cancel: false}).then(function() { deleteSilent(files); }); - - return ret; } /** diff --git a/lib/client/polyfill.js b/lib/client/polyfill.js index 5cc670d2..6ecc1e30 100644 --- a/lib/client/polyfill.js +++ b/lib/client/polyfill.js @@ -61,14 +61,10 @@ var Util, DOM, jQuery; if (!document.removeEventListener) { DOM.Events.remove = function(pType, pElement, pListener) { - var lRet; - if (!pElement) pElement = window; $(pElement).unbind(pType, pListener); - - return lRet; }; } diff --git a/package.json b/package.json index 0418bef5..9e0a12b3 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ }, "devDependencies": { "coveralls": "^2.11.6", - "jscs": "^2.7.0", + "jscs": "^3.0.1", "jshint": "^2.8.0", "minor": "^1.2.2", "morgan": "^1.6.1",