From a6c7d443ae962dea191752f6a4f7146e36571fe9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 22 Jul 2019 20:42:09 +0300 Subject: [PATCH] chore(cloudcmd) lint --- .eslintrc.js | 8 +++----- client/client.js | 4 ++-- client/load-module.js | 4 +--- client/modules/konsole.js | 2 +- client/modules/menu.js | 4 ++-- common/btoa.js | 2 -- madrun.js | 1 + 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 62b14e6c..be18c172 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,9 @@ 'use strict'; module.exports = { + env: { + browser: true, + }, rules: { 'no-console': 0, }, @@ -19,10 +22,5 @@ module.exports = { extends: [ 'plugin:node/recommended', ], - }, { - files: ['client', 'static'], - env: { - browser: true, - }, }], }; diff --git a/client/client.js b/client/client.js index ad911e33..8fd3ccf6 100644 --- a/client/client.js +++ b/client/client.js @@ -243,8 +243,8 @@ function CloudCmdProto(DOM) { const showLoad = Images.show.load; const doBefore = { - 'edit': showLoad, - 'menu': showLoad, + edit: showLoad, + menu: showLoad, }; const load = (name, path, dobefore) => { diff --git a/client/load-module.js b/client/load-module.js index 495cad84..dffcf3f3 100644 --- a/client/load-module.js +++ b/client/load-module.js @@ -18,9 +18,7 @@ module.exports = function loadModule(params) { if (!params) return; - const { - path, - } = params; + const {path} = params; const name = path && noJS(pascalCase(path)); const doBefore = params.dobefore; diff --git a/client/modules/konsole.js b/client/modules/konsole.js index 0683ef09..86b8c9c2 100644 --- a/client/modules/konsole.js +++ b/client/modules/konsole.js @@ -105,7 +105,7 @@ const create = async () => { CloudCmd.on('active-dir', config.if('syncConsolePath', cd(konsole.handler))); konsole.addShortCuts({ - 'P': () => { + P: () => { const command = konsole.getPromptText(); const path = DOM.getCurrentDirPath(); diff --git a/client/modules/menu.js b/client/modules/menu.js index 5616400c..ff9b405c 100644 --- a/client/modules/menu.js +++ b/client/modules/menu.js @@ -117,8 +117,8 @@ function getMenuData(isAuth) { const menu = { 'Paste': Buffer.paste, 'New': { - 'File': DOM.promptNewFile, - 'Directory': DOM.promptNewDir, + File: DOM.promptNewFile, + Directory: DOM.promptNewDir, }, 'Upload': () => { CloudCmd.Upload.show(); diff --git a/common/btoa.js b/common/btoa.js index 0293ebbc..bf26630b 100644 --- a/common/btoa.js +++ b/common/btoa.js @@ -1,7 +1,5 @@ 'use strict'; -/* global btoa */ - module.exports = (str) => { if (typeof btoa === 'function') return btoa(str); diff --git a/madrun.js b/madrun.js index e87dcf1c..e17d6493 100644 --- a/madrun.js +++ b/madrun.js @@ -11,6 +11,7 @@ const {eslint} = predefined; const names = [ 'bin/cloudcmd.js', + 'client', 'common', 'server', 'test',