From 59338a16acb4e675ed85440c30dfda33041d6572 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 5 Jan 2021 13:35:58 +0200 Subject: [PATCH] chore(cloudcmd) lint: key-spacing --- .eslintrc.js | 3 +++ common/cloudfunc.js | 34 +++++++++++++++++----------------- json/config.json | 3 +-- server/config.js | 4 ++-- server/exit.spec.js | 6 +++--- server/route.js | 12 ++++++------ server/terminal.spec.js | 2 +- test/common/cloudfunc.js | 10 +++++----- 8 files changed, 38 insertions(+), 36 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index bc2b16c7..d2cc8b7b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,6 +8,9 @@ module.exports = { 'putout', 'node', ], + rules: { + 'key-spacing': 'off', + }, overrides: [{ files: ['bin/release.js'], rules: { diff --git a/common/cloudfunc.js b/common/cloudfunc.js index 0c8a399a..e4cc5b46 100644 --- a/common/cloudfunc.js +++ b/common/cloudfunc.js @@ -135,9 +135,9 @@ module.exports.buildFromJSON = (params) => { const htmlPath = getPathLink(path, prefix, template.pathLink); let fileTable = rendy(template.path, { - link : prefix + FS + path, - fullPath : path, - path : htmlPath, + link: prefix + FS + path, + fullPath: path, + path: htmlPath, }); const owner = 'owner'; @@ -150,10 +150,10 @@ module.exports.buildFromJSON = (params) => { const date = getFieldName('date'); const header = rendy(templateFile, { - tag : 'div', - attribute : 'data-name="js-fm-header" ', - className : 'fm-header', - type : '', + tag: 'div', + attribute: 'data-name="js-fm-header" ', + className: 'fm-header', + type: '', name, size, date, @@ -173,8 +173,8 @@ module.exports.buildFromJSON = (params) => { const linkResult = rendy(template.link, { link, - title : '..', - name : '..', + title: '..', + name: '..', }); const dataName = 'data-name="js-file-.." '; @@ -182,15 +182,15 @@ module.exports.buildFromJSON = (params) => { /* Сохраняем путь к каталогу верхнего уровня*/ fileTable += rendy(template.file, { - tag : 'li', + tag: 'li', attribute, - className : '', - type : 'directory', - name : linkResult, - size : '<dir>', - date : '--.--.----', - owner : '.', - mode : '--- --- ---', + className: '', + type: 'directory', + name: linkResult, + size: '<dir>', + date: '--.--.----', + owner: '.', + mode: '--- --- ---', }); } diff --git a/json/config.json b/json/config.json index 54e78bfe..7387e158 100644 --- a/json/config.json +++ b/json/config.json @@ -7,7 +7,7 @@ "editor": "edward", "packer": "tar", "diff": true, - "zip" : true, + "zip": true, "buffer": true, "dirStorage": false, "online": false, @@ -44,4 +44,3 @@ "dropbox": false, "dropboxToken": "" } - diff --git a/server/config.js b/server/config.js index 84866cfa..a1760b39 100644 --- a/server/config.js +++ b/server/config.js @@ -186,10 +186,10 @@ function get(manage, request, response) { const data = jonny.stringify(manage('*')); ponse.send(data, { - name : 'config.json', + name: 'config.json', request, response, - cache : false, + cache: false, }); } diff --git a/server/exit.spec.js b/server/exit.spec.js index 432773ee..663bd44a 100644 --- a/server/exit.spec.js +++ b/server/exit.spec.js @@ -5,7 +5,7 @@ const exit = require('./exit'); const stub = require('@cloudcmd/stub'); test('cloudcmd: exit: process.exit', (t) => { - const {exit:exitOriginal} = process; + const {exit: exitOriginal} = process; process.exit = stub(); exit(); @@ -16,7 +16,7 @@ test('cloudcmd: exit: process.exit', (t) => { }); test('cloudcmd: exit: console.error', (t) => { - const {exit:exitOriginal} = process; + const {exit: exitOriginal} = process; const {error} = console; console.error = stub(); @@ -32,7 +32,7 @@ test('cloudcmd: exit: console.error', (t) => { }); test('cloudcmd: exit.error: console.error: error', (t) => { - const {exit:exitOriginal} = process; + const {exit: exitOriginal} = process; const {error} = console; console.error = stub(); diff --git a/server/route.js b/server/route.js index 200149c0..5c48b744 100644 --- a/server/route.js +++ b/server/route.js @@ -137,18 +137,18 @@ function indexProcessing(config, options) { .replace('icon-terminal', 'icon-terminal none'); const left = rendy(Template.panel, { - side : 'left', - content : panel, - className : !oneFilePanel ? '' : 'panel-single', + side: 'left', + content: panel, + className: !oneFilePanel ? '' : 'panel-single', }); let right = ''; if (!oneFilePanel) right = rendy(Template.panel, { - side : 'right', - content : panel, - className : '', + side: 'right', + content: panel, + className: '', }); const name = config('name'); diff --git a/server/terminal.spec.js b/server/terminal.spec.js index 0acacb67..259d3aaf 100644 --- a/server/terminal.spec.js +++ b/server/terminal.spec.js @@ -43,7 +43,7 @@ test('cloudcmd: terminal: enabled', (t) => { }); test('cloudcmd: terminal: enabled: no string', (t) => { - const {log:originalLog} = console; + const {log: originalLog} = console; const log = stub(); console.log = log; diff --git a/test/common/cloudfunc.js b/test/common/cloudfunc.js index 7d3e6ebb..218de467 100644 --- a/test/common/cloudfunc.js +++ b/test/common/cloudfunc.js @@ -34,19 +34,19 @@ const TMPL = [ ].map(addHBS); const data = { - path : '/etc/X11/', - files : [{ + path: '/etc/X11/', + files: [{ name: 'applnk', size: '4.0.0kb', date: '21.02.2016', - uid : 0, + uid: 0, mode: 'rwx r-x r-x', type: 'directory', }, { name: 'ай', size: '1.30kb', date: 0, - uid : 0, + uid: 0, mode: 'rwx r-x r-x', type: 'file', }], @@ -73,7 +73,7 @@ test('cloudfunc: render', (t) => { time('CloudFunc.buildFromJSON'); const result = CloudFunc.buildFromJSON({ - prefix : '', + prefix: '', data, template, });