chore: cloudcmd: actions: lint ☘️

This commit is contained in:
coderaiser 2026-03-17 18:45:13 +00:00
parent c9b27bb514
commit 170b4da211
7 changed files with 19 additions and 3 deletions

View file

@ -16,7 +16,10 @@ export default {
NODE_ENV: 'development', NODE_ENV: 'development',
}), }),
'build:start': () => run(['build:client', 'start']), 'build:start': () => run(['build:client', 'start']),
'build:start:dev': () => run(['build:client:dev', 'start:dev']), 'build:start:dev': () => run([
'build:client:dev',
'start:dev',
]),
'lint:all': () => run('lint:progress'), 'lint:all': () => run('lint:progress'),
'lint': () => 'redlint fix; putout . --rulesdir rules', 'lint': () => 'redlint fix; putout . --rulesdir rules',
'lint:progress': () => run('lint', '-f progress'), 'lint:progress': () => run('lint', '-f progress'),

View file

@ -302,6 +302,7 @@ export const isCurrentIsDir = (currentFile) => {
export const getCurrentType = (currentFile) => { export const getCurrentType = (currentFile) => {
const current = currentFile || DOM.getCurrentFile(); const current = currentFile || DOM.getCurrentFile();
const el = DOM.getByDataName('js-type', current); const el = DOM.getByDataName('js-type', current);
const type = el.className const type = el.className
.split(' ') .split(' ')
.pop(); .pop();

View file

@ -37,6 +37,7 @@ test('cloudcmd: client: key: enable vim', async (t) => {
test('cloudcmd: client: key: disable vim', async (t) => { test('cloudcmd: client: key: disable vim', async (t) => {
const _config = stub(); const _config = stub();
const config = stub(); const config = stub();
const event = { const event = {
keyCode: ESC, keyCode: ESC,
key: 'Escape', key: 'Escape',

View file

@ -447,6 +447,7 @@ test('cloudcmd: client: key: set first file current: ^', async (t) => {
test('cloudcmd: client: key: visual', (t) => { test('cloudcmd: client: key: visual', (t) => {
const element = {}; const element = {};
const toggleSelectedFile = stub(); const toggleSelectedFile = stub();
const Info = { const Info = {
element, element,
}; };
@ -463,6 +464,7 @@ test('cloudcmd: client: key: visual', (t) => {
test('cloudcmd: client: key: ESC', (t) => { test('cloudcmd: client: key: ESC', (t) => {
const element = {}; const element = {};
const unselectFiles = stub(); const unselectFiles = stub();
const Info = { const Info = {
element, element,
}; };
@ -508,6 +510,7 @@ test('cloudcmd: client: key: Enter', async (t) => {
test('cloudcmd: client: key: /', (t) => { test('cloudcmd: client: key: /', (t) => {
const preventDefault = stub(); const preventDefault = stub();
const element = {}; const element = {};
const Info = { const Info = {
element, element,
files: [], files: [],

View file

@ -55,6 +55,7 @@ let EXT;
function header() { function header() {
const fm = DOM.getFM(); const fm = DOM.getFM();
const isDataset = (el) => el.dataset; const isDataset = (el) => el.dataset;
const isPanel = (el) => { const isPanel = (el) => {
return /^js-(left|right)$/.test(el.dataset.name); return /^js-(left|right)$/.test(el.dataset.name);
}; };
@ -309,8 +310,12 @@ function onDragStart(event) {
link.href = prefixURL + '/pack' + Info.path + EXT; link.href = prefixURL + '/pack' + Info.path + EXT;
} }
event.dataTransfer.setData('DownloadURL', 'application/octet-stream' + ':' + name + event.dataTransfer.setData(
':' + link); 'DownloadURL',
'application/octet-stream' + ':' + name +
':' +
link,
);
} }
function getLIElement(element) { function getLIElement(element) {

View file

@ -4,6 +4,7 @@ import {parseUserMenu} from './parse-user-menu.js';
test('cloudcmd: user menu: parse', (t) => { test('cloudcmd: user menu: parse', (t) => {
const fn = stub(); const fn = stub();
const __settings = {}; const __settings = {};
const result = parseUserMenu({ const result = parseUserMenu({
__settings, __settings,
'F2 - Rename file': fn, 'F2 - Rename file': fn,

View file

@ -90,6 +90,7 @@ test('cloudcmd: markdown: no request', async (t) => {
test('cloudcmd: markdown', async (t) => { test('cloudcmd: markdown', async (t) => {
const configManager = cloudcmd.createConfigManager(); const configManager = cloudcmd.createConfigManager();
const fixtureDir = new URL('fixture', import.meta.url).pathname; const fixtureDir = new URL('fixture', import.meta.url).pathname;
const config = { const config = {
auth: false, auth: false,
root: fixtureDir, root: fixtureDir,
@ -109,6 +110,7 @@ test('cloudcmd: markdown', async (t) => {
test('cloudcmd: markdown: zip', async (t) => { test('cloudcmd: markdown: zip', async (t) => {
const configManager = cloudcmd.createConfigManager(); const configManager = cloudcmd.createConfigManager();
const fixtureDir = new URL('fixture', import.meta.url).pathname; const fixtureDir = new URL('fixture', import.meta.url).pathname;
const config = { const config = {
auth: false, auth: false,
root: fixtureDir, root: fixtureDir,