Skip to content

Commit b04cbcd

Browse files
committed
chore: lint
1 parent 094df66 commit b04cbcd

File tree

3 files changed

+37
-40
lines changed

3 files changed

+37
-40
lines changed

.putout.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
"base64": {
1414
"convert-typeof-to-is-type": "off"
1515
},
16-
"route.spec.js": {
17-
"tape/convert-ok-to-match": "off"
18-
},
1916
"*.md": {
2017
"nodejs/convert-commonjs-to-esm": "on"
2118
},

client/key/vim/index.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,46 @@ const getOperations = (event, deps) => {
2828
toggleSelectedFile,
2929
Buffer = {},
3030
} = deps;
31-
31+
3232
return {
3333
escape: unselectFiles,
34-
34+
3535
remove: () => {
3636
Operation.show('delete');
3737
},
38-
38+
3939
makeDirectory: () => {
4040
event.stopImmediatePropagation();
4141
event.preventDefault();
4242
DOM.promptNewDir();
4343
},
44-
44+
4545
makeFile: () => {
4646
event.stopImmediatePropagation();
4747
event.preventDefault();
4848
DOM.promptNewFile();
4949
},
50-
50+
5151
terminal: () => {
5252
CloudCmd.Terminal.show();
5353
},
54-
54+
5555
edit: () => {
5656
CloudCmd.EditFileVim.show();
5757
},
58-
58+
5959
copy: () => {
6060
Buffer.copy();
6161
unselectFiles();
6262
},
63-
63+
6464
select: () => {
6565
const current = Info.element;
6666
toggleSelectedFile(current);
6767
},
68-
68+
6969
paste: Buffer.paste,
70-
70+
7171
moveNext: ({count, isVisual, isDelete}) => {
7272
setCurrent('next', {
7373
count,
@@ -80,7 +80,7 @@ const getOperations = (event, deps) => {
8080
Operation,
8181
});
8282
},
83-
83+
8484
movePrevious: ({count, isVisual, isDelete}) => {
8585
setCurrent('previous', {
8686
count,
@@ -93,25 +93,25 @@ const getOperations = (event, deps) => {
9393
Operation,
9494
});
9595
},
96-
96+
9797
find: async () => {
9898
event.preventDefault();
9999
const [, value] = await Dialog.prompt('Find', '');
100-
100+
101101
if (!value)
102102
return;
103-
103+
104104
const names = Info.files.map(getCurrentName);
105105
const [result] = finder.find(value, names);
106-
106+
107107
setCurrentByName(result);
108108
},
109-
109+
110110
findNext: () => {
111111
const name = finder.findNext();
112112
setCurrentByName(name);
113113
},
114-
114+
115115
findPrevious: () => {
116116
const name = finder.findPrevious();
117117
setCurrentByName(name);
@@ -123,33 +123,33 @@ module.exports.selectFile = selectFileNotParent;
123123

124124
function selectFileNotParent(current, {getCurrentName, selectFile} = DOM) {
125125
const name = getCurrentName(current);
126-
126+
127127
if (name === '..')
128128
return;
129-
129+
130130
selectFile(current);
131131
}
132132

133133
function setCurrent(sibling, {count, isVisual, isDelete}, {Info, setCurrentFile, unselectFiles, Operation}) {
134134
let current = Info.element;
135135
const select = isVisual ? selectFileNotParent : unselectFiles;
136-
136+
137137
select(current);
138-
138+
139139
const position = `${sibling}Sibling`;
140-
140+
141141
for (let i = 0; i < count; i++) {
142142
const next = current[position];
143-
143+
144144
if (!next)
145145
break;
146-
146+
147147
current = next;
148148
select(current);
149149
}
150-
150+
151151
setCurrentFile(current);
152-
152+
153153
if (isDelete)
154154
Operation.show('delete');
155155
}

server/route.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test('cloudcmd: route: buttons: no console', async (t) => {
4343
options,
4444
});
4545

46-
t.ok(/icon-console none/.test(body), 'should hide console');
46+
t.match(body, 'icon-console none', 'should hide console');
4747
t.end();
4848
});
4949

@@ -77,7 +77,7 @@ test('cloudcmd: route: buttons: no config', async (t) => {
7777
options,
7878
});
7979

80-
t.ok(/icon-config none/.test(body), 'should hide config');
80+
t.match(body, 'icon-config none', 'should hide config');
8181
t.end();
8282
});
8383

@@ -94,7 +94,7 @@ test('cloudcmd: route: buttons: no contact', async (t) => {
9494
options,
9595
});
9696

97-
t.ok(/icon-contact none/.test(body), 'should hide contact');
97+
t.match(body, 'icon-contact none', 'should hide contact');
9898
t.end();
9999
});
100100

@@ -111,7 +111,7 @@ test('cloudcmd: route: buttons: one file panel: move', async (t) => {
111111
options,
112112
});
113113

114-
t.ok(/icon-move none/.test(body), 'should hide move button');
114+
t.match(body, 'icon-move none', 'should hide move button');
115115
t.end();
116116
});
117117

@@ -128,7 +128,7 @@ test('cloudcmd: route: buttons: one file panel: copy', async (t) => {
128128
options,
129129
});
130130

131-
t.ok(/icon-copy none/.test(body), 'should hide copy button');
131+
t.match(body, 'icon-copy none', 'should hide copy button');
132132
t.end();
133133
});
134134

@@ -145,7 +145,7 @@ test('cloudcmd: route: keys panel: hide', async (t) => {
145145
options,
146146
});
147147

148-
t.ok(/keyspanel hidden/.test(body), 'should hide keyspanel');
148+
t.match(body, 'keyspanel hidden', 'should hide keyspanel');
149149
t.end();
150150
});
151151

@@ -246,7 +246,7 @@ test('cloudcmd: route: sendIndex: encode', async (t) => {
246246

247247
stopAll();
248248

249-
t.ok(body.includes(nameEncoded), 'should encode name');
249+
t.match(body, nameEncoded, 'should encode name');
250250
t.end();
251251
});
252252

@@ -338,7 +338,7 @@ test('cloudcmd: route: buttons: no terminal', async (t) => {
338338
options,
339339
});
340340

341-
t.ok(/icon-terminal none/.test(body), 'should hide terminal');
341+
t.match(body, 'icon-terminal none', 'should hide terminal');
342342
t.end();
343343
});
344344

@@ -358,7 +358,7 @@ test('cloudcmd: route: no termianl: /fs', async (t) => {
358358
options,
359359
});
360360

361-
t.ok(/icon-terminal none/.test(body), 'should hide terminal');
361+
t.match(body, 'icon-terminal none', 'should hide terminal');
362362
t.end();
363363
});
364364

@@ -376,7 +376,7 @@ test('cloudcmd: route: buttons: terminal: can not load', async (t) => {
376376
options,
377377
});
378378

379-
t.ok(/icon-terminal none/.test(body), 'should not enable terminal');
379+
t.match(body, 'icon-terminal none', 'should not enable terminal');
380380
t.end();
381381
});
382382

@@ -427,7 +427,7 @@ test('cloudcmd: route: dropbox', async (t) => {
427427
const readdir = _getReadDir(config);
428428
const [e] = await tryToCatch(readdir, '/root');
429429

430-
t.ok(/API/.test(e.message), 'should contain word token in message');
430+
t.match(e.message, 'API', 'should contain word token in message');
431431
t.end();
432432
});
433433

0 commit comments

Comments
 (0)