mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
81e76857da
commit
ef10ebe97c
40 changed files with 137 additions and 134 deletions
|
|
@ -11,15 +11,11 @@ const {addSlashToEnd} = require('format-io');
|
|||
const pascalCase = require('just-pascal-case');
|
||||
const currify = require('currify');
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
const Images = require('./dom/images');
|
||||
|
||||
const {unregisterSW} = require('./sw/register');
|
||||
const getJsonFromFileTable = require('./get-json-from-file-table');
|
||||
const Key = require('./key');
|
||||
|
||||
const noJS = (a) => a.replace(/.js$/, '');
|
||||
|
||||
const {
|
||||
apiURL,
|
||||
formatMsg,
|
||||
|
|
@ -28,6 +24,10 @@ const {
|
|||
|
||||
const loadModule = require('./load-module');
|
||||
|
||||
const noJS = (a) => a.replace(/.js$/, '');
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
inherits(CloudCmdProto, Emitify);
|
||||
|
||||
module.exports = new CloudCmdProto(DOM);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ require('../css/columns/name-size.css');
|
|||
const wraptile = require('wraptile');
|
||||
const load = require('load.js');
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
const {
|
||||
registerSW,
|
||||
listenSW,
|
||||
} = require('./sw/register');
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
// prevent additional loading of emitify
|
||||
window.Emitify = require('emitify');
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ const {
|
|||
stub,
|
||||
} = require('supertape');
|
||||
const {create} = require('auto-globals');
|
||||
const id = (a) => a;
|
||||
const wraptile = require('wraptile');
|
||||
const returns = wraptile(id);
|
||||
|
||||
const currentFile = require('./current-file');
|
||||
const id = (a) => a;
|
||||
|
||||
const returns = wraptile(id);
|
||||
const {_CURRENT_FILE} = currentFile;
|
||||
|
||||
test('current-file: setCurrentName: setAttribute', (t) => {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ test('event-store: get', (t) => {
|
|||
[el, name, fn],
|
||||
];
|
||||
|
||||
t.deepEqual(result, expected, 'should equal');
|
||||
t.deepEqual(result, expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
@ -29,6 +29,6 @@ test('event-store: clear', (t) => {
|
|||
const result = eventStore.get();
|
||||
const expected = [];
|
||||
|
||||
t.deepEqual(result, expected, 'should equal');
|
||||
t.deepEqual(result, expected);
|
||||
t.end();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ const {alert} = require('./dialog');
|
|||
|
||||
const {FS} = require('../../common/cloudfunc');
|
||||
|
||||
const onEnd = wraptile(_onEnd);
|
||||
const {getCurrentDirPath: getPathWhenRootEmpty} = require('.');
|
||||
const loadFile = wraptile(_loadFile);
|
||||
|
||||
const {getCurrentDirPath: getPathWhenRootEmpty} = require('.');
|
||||
const onEnd = wraptile(_onEnd);
|
||||
|
||||
module.exports = (dir, files) => {
|
||||
if (!files) {
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
/* global CloudCmd, DOM */
|
||||
|
||||
const Info = DOM.CurrentInfo;
|
||||
|
||||
const clipboard = require('@cloudcmd/clipboard');
|
||||
|
||||
const Buffer = require('../dom/buffer');
|
||||
const Events = require('../dom/events');
|
||||
|
||||
const Events = require('../dom/events');
|
||||
const KEY = require('./key');
|
||||
|
||||
const vim = require('./vim');
|
||||
const setCurrentByChar = require('./set-current-by-char');
|
||||
const {createBinder} = require('./binder');
|
||||
|
||||
const fullstore = require('fullstore');
|
||||
|
||||
const Info = DOM.CurrentInfo;
|
||||
const Chars = fullstore();
|
||||
|
||||
const toggleVim = (keyCode) => {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
'use strict';
|
||||
|
||||
const autoGlobals = require('auto-globals');
|
||||
const test = autoGlobals(require('supertape'));
|
||||
const stub = require('@cloudcmd/stub');
|
||||
const mockRequire = require('mock-require');
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
const {ESC} = require('./key');
|
||||
|
||||
const {
|
||||
getDOM,
|
||||
getCloudCmd,
|
||||
} = require('./vim/globals.fixture');
|
||||
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
const test = autoGlobals(require('supertape'));
|
||||
|
||||
global.DOM = getDOM();
|
||||
global.CloudCmd = getCloudCmd();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
const Info = DOM.CurrentInfo;
|
||||
const {escapeRegExp} = require('../../common/util');
|
||||
const Info = DOM.CurrentInfo;
|
||||
|
||||
module.exports = function setCurrentByChar(char, charStore) {
|
||||
let firstByName;
|
||||
|
|
|
|||
|
|
@ -7,12 +7,10 @@ const {
|
|||
stub,
|
||||
} = require('supertape');
|
||||
const mockRequire = require('mock-require');
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
const dir = '../';
|
||||
|
||||
const pathVim = join(dir, 'vim');
|
||||
const pathFind = join(dir, 'vim', 'find');
|
||||
|
||||
const {
|
||||
getDOM,
|
||||
|
|
@ -22,11 +20,14 @@ const {
|
|||
global.DOM = getDOM();
|
||||
global.CloudCmd = getCloudCmd();
|
||||
|
||||
const {DOM} = global;
|
||||
const {Buffer} = DOM;
|
||||
|
||||
const vim = require(pathVim);
|
||||
|
||||
const {DOM} = global;
|
||||
|
||||
const {Buffer} = DOM;
|
||||
const pathFind = join(dir, 'vim', 'find');
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
test('cloudcmd: client: key: set next file: no', (t) => {
|
||||
const element = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ const tryToCatch = require('try-to-catch');
|
|||
const clipboard = require('@cloudcmd/clipboard');
|
||||
|
||||
const getRange = require('./get-range');
|
||||
const getIndex = currify(require('./get-index'));
|
||||
const uploadFiles = require('../dom/upload-files');
|
||||
|
||||
const {FS} = require('../../common/cloudfunc');
|
||||
|
||||
const getIndex = currify(require('./get-index'));
|
||||
|
||||
const NBSP_REG = RegExp(String.fromCharCode(160), 'g');
|
||||
const SPACE = ' ';
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ const exec = require('execon');
|
|||
const currify = require('currify');
|
||||
const load = require('load.js');
|
||||
|
||||
const {log} = CloudCmd;
|
||||
|
||||
const {ajax} = require('../dom/load');
|
||||
|
||||
const Files = require('../dom/files');
|
||||
const Images = require('../dom/images');
|
||||
const {log} = CloudCmd;
|
||||
|
||||
const upload = currify(_upload);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ const {promisify} = require('es6-promisify');
|
|||
const tryToCatch = require('try-to-catch');
|
||||
const createElement = require('@cloudcmd/create-element');
|
||||
const load = require('load.js');
|
||||
const loadJS = load.js;
|
||||
|
||||
const {MAX_FILE_SIZE: maxSize} = require('../../common/cloudfunc');
|
||||
|
||||
const {time, timeEnd} = require('../../common/util');
|
||||
const loadJS = load.js;
|
||||
|
||||
const Name = 'Edit';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
/* global DOM */
|
||||
|
||||
const forEachKey = require('for-each-key');
|
||||
|
||||
const wraptile = require('wraptile');
|
||||
const format = require('./format');
|
||||
|
||||
const {
|
||||
Dialog,
|
||||
Images,
|
||||
} = DOM;
|
||||
|
||||
const forEachKey = require('for-each-key');
|
||||
const wraptile = require('wraptile');
|
||||
|
||||
const format = require('./format');
|
||||
|
||||
module.exports = (options) => (emitter) => {
|
||||
const {
|
||||
operation,
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
require('css-modules-require-hook/preset');
|
||||
|
||||
const autoGlobals = require('auto-globals');
|
||||
const test = autoGlobals(require('supertape'));
|
||||
const stub = require('@cloudcmd/stub');
|
||||
const mockRequire = require('mock-require');
|
||||
const test = autoGlobals(require('supertape'));
|
||||
const {reRequire, stopAll} = mockRequire;
|
||||
|
||||
test('cloudcmd: client: view: initConfig', (t) => {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
const autoGlobals = require('auto-globals');
|
||||
const tape = require('supertape');
|
||||
|
||||
const test = autoGlobals(tape);
|
||||
|
||||
const stub = require('@cloudcmd/stub');
|
||||
|
||||
const tryCatch = require('try-catch');
|
||||
const {reRequire} = require('mock-require');
|
||||
const test = autoGlobals(tape);
|
||||
|
||||
test('sw: listen', (t) => {
|
||||
const {listenSW} = reRequire('./register');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue