diff --git a/.eslintrc.json b/.eslintrc.json index d666951e9..547565ec6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -113,7 +113,7 @@ "no-continue": "off", "no-div-regex": "error", "no-duplicate-imports": "error", - "no-else-return": "off", + "no-else-return": 2, "no-empty-function": "off", "no-eq-null": "error", "no-eval": "off", diff --git a/lib/core/config.js b/lib/core/config.js index fb95558e4..f5bfde929 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -156,9 +156,8 @@ Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, ena if (env) { return utils.recursiveMerge(configObject['default'] || {}, configObject[env]); - } else { - return configObject; } + return configObject; }; Config.prototype._getFileOrOject = function(object, filePath, property) { diff --git a/lib/core/plugin.js b/lib/core/plugin.js index 70957ffac..2eed8bfa6 100644 --- a/lib/core/plugin.js +++ b/lib/core/plugin.js @@ -230,9 +230,8 @@ Plugin.prototype.runPipeline = function(args) { var shouldRunPipeline = utils.fileMatchesPattern(pipeline.matcthingFiles, args.targetFile); if (shouldRunPipeline) { return pipeline.cb.call(this, args); - } else { - return args.source; } + return args.source; }; module.exports = Plugin; diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index 65bb92e44..7f8ecaf2b 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -313,9 +313,8 @@ var BlockchainClient = function(blockchainConfig, client, env, onReadyCallback, // TODO add other clients at some point if (client === 'geth') { return new Blockchain({blockchainConfig, client: GethCommands, env, isDev, onReadyCallback, onExitCallback}); - } else { - throw new Error('unknown client'); } + throw new Error('unknown client'); }; module.exports = BlockchainClient; diff --git a/lib/modules/code_generator/index.js b/lib/modules/code_generator/index.js index cd5dfdf81..5c53da23c 100644 --- a/lib/modules/code_generator/index.js +++ b/lib/modules/code_generator/index.js @@ -304,11 +304,10 @@ class CodeGenerator { self.events.request("version:get:web3", function(web3Version) { if (web3Version === "1.0.0-beta") { return next(null, fs.embarkPath("node_modules/web3")); - } else { - self.events.request("version:getPackageLocation", "web3", web3Version, function(err, location) { - return next(null, fs.dappPath(location)); - }); } + self.events.request("version:getPackageLocation", "web3", web3Version, function(err, location) { + return next(null, fs.dappPath(location)); + }); }); }, function getImports(web3Location, next) { @@ -370,11 +369,10 @@ class CodeGenerator { self.events.request("version:get:web3", function(web3Version) { if (web3Version === "1.0.0-beta") { return next(null, utils.joinPath(fs.embarkPath("node_modules/web3"))); - } else { - self.events.request("version:getPackageLocation", "web3", web3Version, function(err, location) { - return next(null, fs.dappPath(location)); - }); } + self.events.request("version:getPackageLocation", "web3", web3Version, function(err, location) { + return next(null, fs.dappPath(location)); + }); }); }, function getImports(web3Location, next) { diff --git a/lib/modules/deployment/contract_deployer.js b/lib/modules/deployment/contract_deployer.js index de935fa73..3e352a35f 100644 --- a/lib/modules/deployment/contract_deployer.js +++ b/lib/modules/deployment/contract_deployer.js @@ -235,9 +235,8 @@ class ContractDeployer { } catch(e) { if (e.message.indexOf('Invalid number of parameters for "undefined"') >= 0) { return next(new Error(__("attempted to deploy %s without specifying parameters", contract.className))); - } else { - return next(new Error(e)); } + return next(new Error(e)); } next(); }, diff --git a/lib/modules/whisper/index.js b/lib/modules/whisper/index.js index 2211d5893..861b61357 100644 --- a/lib/modules/whisper/index.js +++ b/lib/modules/whisper/index.js @@ -38,9 +38,8 @@ class Whisper { self.web3.shh.getVersion(function (err, version) { if (err || version == "2") { return cb({name: 'Whisper', status: 'off'}); - } else { - return cb({name: 'Whisper (version ' + version + ')', status: 'on'}); } + return cb({name: 'Whisper (version ' + version + ')', status: 'on'}); }); }); } diff --git a/lib/utils/utils.js b/lib/utils/utils.js index 808a45fea..7ccbc620a 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -277,9 +277,8 @@ function isValidDomain(domain) { function isValidEthDomain(ethDomain) { if (!isValidDomain(ethDomain)) { return false; - } else { - return ethDomain.substring(ethDomain.lastIndexOf('.'), ethDomain.length) === '.eth'; } + return ethDomain.substring(ethDomain.lastIndexOf('.'), ethDomain.length) === '.eth'; } function decodeParams(typesArray, hexString) {