From 5c19ddba61e2b8868fe884c95589e46b5c54ee1a Mon Sep 17 00:00:00 2001 From: coderiaser Date: Tue, 17 Mar 2026 20:43:43 +0200 Subject: [PATCH] chore: lint --- .github/workflows/nodejs.yml | 4 ++-- bin/release.js | 13 ++++++++----- client/modules/edit-names.js | 5 ++++- common/cloudfunc.spec.js | 7 +++++++ common/util.spec.js | 1 + server/cloudcmd.js | 1 + server/columns.js | 1 + server/config.js | 1 + server/route.js | 1 + server/route.spec.js | 2 ++ server/theme.js | 1 + server/validate.js | 2 ++ static/user-menu.spec.js | 1 + test/static.js | 1 + 14 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 8f3c99ce..0080488a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -11,7 +11,7 @@ jobs: node-version: - 22.x - 24.x - - 25.6.1 + - 25.x steps: - uses: actions/checkout@v5 - uses: oven-sh/setup-bun@v2 @@ -27,7 +27,7 @@ jobs: run: bun i --no-save - name: Lint run: redrun fix:lint - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: | ~/.cargo/bin/ diff --git a/bin/release.js b/bin/release.js index a5eb39e2..fbc08e35 100755 --- a/bin/release.js +++ b/bin/release.js @@ -19,10 +19,12 @@ await main(); async function main() { const history = '## Version history\n\n'; const link = '//github.com/coderaiser/cloudcmd/releases/tag/'; + const template = '- ' + '*{{ date }}*, ' + '**[v{{ version }}]' + - '(' + link + + '(' + + link + 'v{{ version }})**\n'; const {version} = Info; @@ -35,10 +37,11 @@ async function main() { await replaceVersion('README.md', version, versionNew); await replaceVersion('HELP.md', version, versionNew); - const historyNew = history + rendy(template, { - date: shortdate(), - version: versionNew, - }); + const historyNew = history + + rendy(template, { + date: shortdate(), + version: versionNew, + }); await replaceVersion('HELP.md', history, historyNew); } diff --git a/client/modules/edit-names.js b/client/modules/edit-names.js index 45a0cf16..7bc29054 100644 --- a/client/modules/edit-names.js +++ b/client/modules/edit-names.js @@ -63,7 +63,10 @@ async function keyListener(event) { if (ctrlMeta && event.keyCode === Key.S) { hide(); - } else if (ctrlMeta && event.keyCode === Key.P) { + return; + } + + if (ctrlMeta && event.keyCode === Key.P) { const [, pattern] = await Dialog.prompt('Apply pattern:', '[n][e]'); pattern && applyPattern(pattern); } diff --git a/common/cloudfunc.spec.js b/common/cloudfunc.spec.js index ec991f16..aa50a9f9 100644 --- a/common/cloudfunc.spec.js +++ b/common/cloudfunc.spec.js @@ -53,6 +53,7 @@ test('cloudfunc: buildFromJSON: ..', (t) => { test('cloudfunc: getPathLink: /', (t) => { const {pathLink} = template; const result = getPathLink('/', '', pathLink); + const expected = montag` / `; @@ -64,6 +65,7 @@ test('cloudfunc: getPathLink: /', (t) => { test('cloudfunc: getPathLink: /hello/world', (t) => { const {pathLink} = template; const result = getPathLink('/hello/world', '', pathLink); + const expected = montag` /hello/ `; @@ -75,6 +77,7 @@ test('cloudfunc: getPathLink: /hello/world', (t) => { test('cloudfunc: getPathLink: prefix', (t) => { const {pathLink} = template; const result = getPathLink('/hello/world', '/cloudcmd', pathLink); + const expected = montag` /hello/ `; @@ -86,6 +89,7 @@ test('cloudfunc: getPathLink: prefix', (t) => { test('cloudfunc: getSize: dir', (t) => { const type = 'directory'; const size = 0; + const result = _getSize({ type, size, @@ -100,6 +104,7 @@ test('cloudfunc: getSize: dir', (t) => { test('cloudfunc: getSize: link: dir', (t) => { const type = 'directory-link'; const size = 0; + const result = _getSize({ type, size, @@ -114,6 +119,7 @@ test('cloudfunc: getSize: link: dir', (t) => { test('cloudfunc: getSize: link: file', (t) => { const type = 'file-link'; const size = 0; + const result = _getSize({ type, size, @@ -128,6 +134,7 @@ test('cloudfunc: getSize: link: file', (t) => { test('cloudfunc: getSize: file', (t) => { const type = 'file'; const size = '100.00kb'; + const result = _getSize({ type, size, diff --git a/common/util.spec.js b/common/util.spec.js index 870e55e8..6a32848c 100644 --- a/common/util.spec.js +++ b/common/util.spec.js @@ -63,6 +63,7 @@ test('util: findObjByNameInArr: object', (t) => { test('util: findObjByNameInArr: array', (t) => { const name = 'hello'; const data = 'abc'; + const item = { name, data, diff --git a/server/cloudcmd.js b/server/cloudcmd.js index 8a071c81..319cc4ae 100644 --- a/server/cloudcmd.js +++ b/server/cloudcmd.js @@ -51,6 +51,7 @@ export default cloudcmd; export function cloudcmd(params) { const p = params || {}; const options = p.config || {}; + const config = p.configManager || createConfig({ configPath, }); diff --git a/server/columns.js b/server/columns.js index 570fe642..eff63957 100644 --- a/server/columns.js +++ b/server/columns.js @@ -35,6 +35,7 @@ export const getColumns = ({isDev = _isDev()} = {}) => { const readFilesSyncMemo = nanomemoize((isDev) => { const dist = getDist(isDev); const columnsDir = path.join(__dirname, '..', dist, 'columns'); + const names = fs .readdirSync(columnsDir) .filter(not(isMap)); diff --git a/server/config.js b/server/config.js index d52088ab..0977b8a4 100644 --- a/server/config.js +++ b/server/config.js @@ -197,6 +197,7 @@ function get(manage, request, response) { async function patch(manage, request, response) { const name = 'config.json'; const cache = false; + const options = { name, request, diff --git a/server/route.js b/server/route.js index 3b764b81..1d887874 100644 --- a/server/route.js +++ b/server/route.js @@ -65,6 +65,7 @@ export const _getReadDir = getReadDir; async function route({config, options, request, response}) { const name = ponse.getPathName(request); const gzip = true; + const p = { request, response, diff --git a/server/route.spec.js b/server/route.spec.js index c190eefc..7387a9fc 100644 --- a/server/route.spec.js +++ b/server/route.spec.js @@ -243,6 +243,7 @@ test('cloudcmd: route: sendIndex: encode', async (t) => { test('cloudcmd: route: sendIndex: encode: not encoded', async (t) => { const name = '">'; const path = '/'; + const files = [{ name, }]; @@ -276,6 +277,7 @@ test('cloudcmd: route: sendIndex: encode: not encoded', async (t) => { test('cloudcmd: route: sendIndex: ddos: render', async (t) => { const name = `$$$'"`; const path = '/'; + const files = [{ name, }]; diff --git a/server/theme.js b/server/theme.js index 7e1f2da4..d66623b5 100644 --- a/server/theme.js +++ b/server/theme.js @@ -24,6 +24,7 @@ export const getThemes = ({isDev = _isDev()} = {}) => { const readFilesSyncMemo = nanomemoize((isDev) => { const dist = getDist(isDev); const themesDir = path.join(__dirname, '..', dist, 'themes'); + const names = fs .readdirSync(themesDir) .filter(not(isMap)); diff --git a/server/validate.js b/server/validate.js index 61b3a31d..233aebcd 100644 --- a/server/validate.js +++ b/server/validate.js @@ -55,6 +55,7 @@ export const columns = (type, overrides = {}) => { } = overrides; const addQuotes = (a) => `"${a}"`; + const all = Object .keys(getColumns()) .concat(''); @@ -75,6 +76,7 @@ export const theme = (type, overrides = {}) => { } = overrides; const addQuotes = (a) => `"${a}"`; + const all = Object .keys(getThemes()) .concat(''); diff --git a/static/user-menu.spec.js b/static/user-menu.spec.js index 47e4a816..e1543608 100644 --- a/static/user-menu.spec.js +++ b/static/user-menu.spec.js @@ -30,6 +30,7 @@ test('cloudcmd: static: user menu: Rename', async (t) => { test('cloudcmd: static: user menu: R', (t) => { const name = 'R - cd /'; const changeDir = stub(); + const CloudCmd = { changeDir, }; diff --git a/test/static.js b/test/static.js index 1b725955..cdb6b9e7 100644 --- a/test/static.js +++ b/test/static.js @@ -83,6 +83,7 @@ test('cloudcmd: /cloudcmd.js: auth: access denied', async (t) => { test('cloudcmd: /cloudcmd.js: auth: no password', async (t) => { const name = 'cloudcmd.js'; const username = 'hello'; + const config = { auth: true, username,