Skip to content
Permalink
Browse files
eslint cleanup fixes: operator-linebreak (#86)
- remove operator-linebreak exception from .eslintrc.yml
- reformat ternary expresssions according to (semi)standard
- reformat error message expressions according to (semi)standard

as done by the following command, with no operator-linebreak
exception enabled:

    npm run eslint -- --fix
  • Loading branch information
Chris Brody committed Jul 18, 2019
1 parent cbe9632 commit 83954d691d16fe6599305cfdb5107ce5b287457d
Showing 5 changed files with 17 additions and 18 deletions.
@@ -6,7 +6,6 @@ rules:
- 4
camelcase: off
padded-blocks: off
operator-linebreak: off
no-unused-vars:
- error
- args: after-used
@@ -90,9 +90,9 @@ PlatformMunger.prototype.remove_plugin_changes = remove_plugin_changes;
function remove_plugin_changes (pluginInfo, is_top_level) {
var self = this;
var platform_config = self.platformJson.root;
var plugin_vars = is_top_level ?
platform_config.installed_plugins[pluginInfo.id] :
platform_config.dependent_plugins[pluginInfo.id];
var plugin_vars = is_top_level
? platform_config.installed_plugins[pluginInfo.id]
: platform_config.dependent_plugins[pluginInfo.id];
var edit_config_changes = null;
if (pluginInfo.getEditConfigs) {
edit_config_changes = pluginInfo.getEditConfigs(self.platform);
@@ -79,9 +79,9 @@ function ConfigFile_load () {
// We always write out text plist, not binary.
// Do we still need to support binary plist?
// If yes, use plist.parseStringSync() and read the file once.
self.data = isBinaryPlist(filepath) ?
modules.bplist.parseBuffer(fs.readFileSync(filepath))[0] :
modules.plist.parse(fs.readFileSync(filepath, 'utf8'));
self.data = isBinaryPlist(filepath)
? modules.bplist.parseBuffer(fs.readFileSync(filepath))[0]
: modules.plist.parse(fs.readFileSync(filepath, 'utf8'));
}
}

@@ -72,9 +72,9 @@ PlatformJson.prototype.isPluginInstalled = function (pluginId) {
};

PlatformJson.prototype.addPlugin = function (pluginId, variables, isTopLevel) {
var pluginsList = isTopLevel ?
this.root.installed_plugins :
this.root.dependent_plugins;
var pluginsList = isTopLevel
? this.root.installed_plugins
: this.root.dependent_plugins;

pluginsList[pluginId] = variables;

@@ -114,9 +114,9 @@ PlatformJson.prototype.addPluginMetadata = function (pluginInfo) {
};

PlatformJson.prototype.removePlugin = function (pluginId, isTopLevel) {
var pluginsList = isTopLevel ?
this.root.installed_plugins :
this.root.dependent_plugins;
var pluginsList = isTopLevel
? this.root.installed_plugins
: this.root.dependent_plugins;

delete pluginsList[pluginId];

@@ -68,9 +68,9 @@ function PluginInfo (dirname) {

if (!src || !target) {
var msg =
'Malformed <asset> tag. Both "src" and "target" attributes'
+ 'must be specified in\n'
+ self.filepath
'Malformed <asset> tag. Both "src" and "target" attributes' +
'must be specified in\n' +
self.filepath
;
throw new Error(msg);
}
@@ -113,8 +113,8 @@ function PluginInfo (dirname) {

if (!dep.id) {
var msg =
'<dependency> tag is missing id attribute in '
+ self.filepath
'<dependency> tag is missing id attribute in ' +
self.filepath
;
throw new CordovaError(msg);
}

0 comments on commit 83954d6

Please sign in to comment.