Update eslint

This commit is contained in:
Jiiks 2018-08-15 09:10:11 +03:00
parent 9f8a1f08be
commit b971b716bf
6 changed files with 17 additions and 17 deletions

View File

@ -25,17 +25,18 @@
], ],
"prefer-template": "warn", "prefer-template": "warn",
"no-return-await": "error", "no-return-await": "error",
"indent": [ "error", 4 ], "indent": [ "warn", 4 ],
"no-lonely-if": "error", "no-lonely-if": "error",
"no-multiple-empty-lines": [ "no-multiple-empty-lines": [
"warn", "warn",
{ "max": 1 } { "max": 1 }
], ],
"no-tabs": "error", "no-tabs": "warn",
"no-trailing-spaces": "error", "no-trailing-spaces": "warn",
"no-unneeded-ternary": "error", "no-unneeded-ternary": "warn",
"no-useless-constructor": "warn", "no-useless-constructor": "warn",
"no-var": "error", "no-var": "error",
"prefer-const": "error" "prefer-const": "error",
"no-else-return": "error"
} }
} }

View File

@ -287,7 +287,9 @@ export default class {
newcontent.start(false); newcontent.start(false);
} }
return newcontent; return newcontent;
} else this.localContent.splice(index, 1); }
this.localContent.splice(index, 1);
} catch (err) { } catch (err) {
Logger.err(this.moduleName, err); Logger.err(this.moduleName, err);
throw err; throw err;

View File

@ -111,13 +111,11 @@ class Helpers {
if (match) { if (match) {
if (selector.child) { if (selector.child) {
return getDirectChild(item, selector.child); return getDirectChild(item, selector.child);
} } else if (selector.successor) {
else if (selector.successor) {
return this.getFirstChild(parent, key, selector.successor); return this.getFirstChild(parent, key, selector.successor);
} }
else {
return { item, parent, key }; return { item, parent, key };
}
} }
}; };
return this.returnFirst(this.recursiveChildren(rootParent, rootKey), checkFilter.bind(null, selector)) || {}; return this.returnFirst(this.recursiveChildren(rootParent, rootKey), checkFilter.bind(null, selector)) || {};

View File

@ -79,11 +79,9 @@ export default class Theme extends Content {
css: result.css.toString(), css: result.css.toString(),
files: result.stats.includedFiles files: result.stats.includedFiles
}; };
} else {
return {
css: await FileUtils.readFile(this.paths.mainPath)
};
} }
return { css: await FileUtils.readFile(this.paths.mainPath) }
} }
/** /**

View File

@ -47,7 +47,7 @@ export default class Setting {
else if (args.type === 'kvp') return new KvpSetting(args, ...merge); else if (args.type === 'kvp') return new KvpSetting(args, ...merge);
else if (args.type === 'securekvp') return new SecureKvpSetting(args, ...merge); else if (args.type === 'securekvp') return new SecureKvpSetting(args, ...merge);
else if (args.type === 'custom') return new CustomSetting(args, ...merge); else if (args.type === 'custom') return new CustomSetting(args, ...merge);
else throw {message: `Setting type ${args.type} unknown`}; throw {message: `Setting type ${args.type} unknown`};
} }
} }

View File

@ -197,7 +197,8 @@ export class WindowUtils extends Module {
if (!nodeIntegration) return window.send('--bd-inject-script', {script: fpath, variable}); if (!nodeIntegration) return window.send('--bd-inject-script', {script: fpath, variable});
if (variable) return window.executeJavaScript(`window["${escaped_variable}"] = require("${escaped_path}");`); if (variable) return window.executeJavaScript(`window["${escaped_variable}"] = require("${escaped_path}");`);
else return window.executeJavaScript(`require("${escaped_path}");`);
return window.executeJavaScript(`require("${escaped_path}");`);
} }
on(event, callback) { on(event, callback) {