chore(cloudcmd) lint

This commit is contained in:
coderaiser 2021-09-30 17:22:59 +03:00
parent 8f466b4c9a
commit 111eba8c31
33 changed files with 139 additions and 155 deletions

View file

@ -150,7 +150,7 @@ test('current-file: isCurrentFile: no', (t) => {
global.DOM = DOM;
global.CloudCmd = CloudCmd;
t.equal(result, expect, 'should equal');
t.equal(result, expect);
t.end();
});

View file

@ -49,9 +49,7 @@ module.exports.getById = (id, element = document) => {
* @param className - className
* @param element - element
*/
module.exports.getByClass = (className, element = document) => {
return DOM.getByClassAll(className, element)[0];
};
module.exports.getByClass = (className, element = document) => DOM.getByClassAll(className, element)[0];
module.exports.getByDataName = (attribute, element = document) => {
const selector = '[' + 'data-name="' + attribute + '"]';

View file

@ -14,7 +14,5 @@ module.exports.clear = () => {
list = [];
};
module.exports.get = () => {
return list;
};
module.exports.get = () => list;

View file

@ -19,12 +19,12 @@ const timeout = getTimeoutOnce(2000);
module.exports.get = getFile;
async function getFile(name) {
function getFile(name) {
const type = itype(name);
check(name);
if (type === 'string')
return await getModule(name);
return getModule(name);
if (type === 'array')
return Promise.all(name.map(getFile));
@ -35,7 +35,7 @@ function check(name) {
throw Error('name could not be empty!');
}
async function getModule(name) {
function getModule(name) {
const regExpHTML = new RegExp(FILES_HTML + '|' + FILES_HTML_ROOT);
const regExpJSON = new RegExp(FILES_JSON);
@ -73,7 +73,7 @@ function getPath(name, isHTML, isJSON) {
function showError(name) {
const str = 'Wrong file name: ' + name;
const error = new Error(str);
const error = Error(str);
throw error;
}

View file

@ -509,9 +509,7 @@ module.exports.saveDataToStorage = async (name, data, hash) => {
return hash;
};
module.exports.getFM = () => {
return DOM.getPanel().parentElement;
};
module.exports.getFM = () => DOM.getPanel().parentElement;
module.exports.getPanelPosition = (panel) => {
panel = panel || DOM.getPanel();

View file

@ -8,7 +8,7 @@ test('cloudcmd: client: io: replaceHash', (t) => {
const result = _replaceHash(url);
const expected = '/hello/%23%23%23%23world';
t.equal(result, expected, 'should equal');
t.equal(result, expected);
t.end();
});

View file

@ -36,9 +36,7 @@ module.exports = (name, options, callback = options) => {
local = [module.local];
}
const localURL = local.map((url) => {
return prefix + url;
});
const localURL = local.map((url) => prefix + url);
const remoteURL = remoteTmpls.map((tmpl) => {
return rendy(tmpl, {