Remove lint warnings

This commit is contained in:
Andrew Stewart 2015-04-18 17:15:55 -07:00
parent e9416129ee
commit a66b66bd52
2 changed files with 10 additions and 22 deletions

View File

@ -88,26 +88,16 @@ Cylon.api = function api(Server, opts) {
try {
Server = require(req);
} catch (e) {
if (e.code === "MODULE_NOT_FOUND") {
var messages;
if (req === "cylon-api-http") {
messages = [
"The HTTP API is no longer included in Cylon by default.",
"To use it, install the plugin module: `npm install cylon-api-http`"
];
} else {
messages = [
"Cannot find the " + req + " API module.",
"You may be able to install it: `npm install " + req + "`"
];
}
_.each(messages, _.arity(Logger.fatal, 1));
throw new Error("Missing API plugin - cannot proceed");
} else {
if (e.code !== "MODULE_NOT_FOUND") {
throw e;
}
[
"Cannot find the " + req + " API module.",
"You may be able to install it: `npm install " + req + "`"
].forEach(_.arity(Logger.fatal, 1));
throw new Error("Missing API plugin - cannot proceed");
}
}

View File

@ -6,8 +6,6 @@
* Licensed under the Apache 2.0 license.
*/
/* eslint camelcase: 0 */
"use strict";
var Basestar = require("./basestar"),
@ -85,7 +83,7 @@ Driver.prototype.setupCommands = function(commands, proxy) {
Utils.proxyFunctionsToObject(commands, proxy, this);
commands.forEach(function(command) {
var snake_case = command.replace(/[A-Z]+/g, function(match) {
var snakeCase = command.replace(/[A-Z]+/g, function(match) {
if (match.length > 1) {
match = match.replace(/[A-Z]$/, function(m) {
return "_" + m.toLowerCase();
@ -95,7 +93,7 @@ Driver.prototype.setupCommands = function(commands, proxy) {
return "_" + match.toLowerCase();
}).replace(/^_/, "");
this.commands[snake_case] = this[command];
this.commands[snakeCase] = this[command];
}, this);
};