From f17e026de64a75cbdbb4228403dbfe413d184805 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:48:44 +0800 Subject: [PATCH] chore(deps-dev): bump eslint-plugin-unicorn from 69.0.0 to 70.0.0 (#22405) * chore(deps-dev): bump eslint-plugin-unicorn from 69.0.0 to 70.0.0 Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 69.0.0 to 70.0.0. - [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases) - [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v69.0.0...v70.0.0) --- updated-dependencies: - dependency-name: eslint-plugin-unicorn dependency-version: 70.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * style: fix prefer-simplified-conditions * style: fix prefer-block-statement-over-iife * style: fix no-unsafe-promise-all-settled-values * style: add unicorn v70 recommded preset --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: TonyRL --- .oxlintrc.json | 10 ++++++++++ lib/routes/4chan/utils.tsx | 2 +- lib/routes/bilibili/wasm-exec.ts | 1 + lib/routes/f95zone/utils.ts | 2 +- lib/routes/follow/profile.ts | 2 +- lib/routes/sigsac/ccs.ts | 6 ++++++ package.json | 2 +- pnpm-lock.yaml | 26 +++++++++++++------------- 8 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 8d53314eb..c70509d11 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -194,6 +194,7 @@ // "unicorn/no-array-sort": "error", "unicorn-js/no-array-sort-for-min-max": "error", "unicorn-js/no-array-splice": "error", + "unicorn-js/no-async-promise-finally": "error", // "unicorn/no-await-expression-member": "error", "unicorn/no-await-in-promise-methods": "error", "unicorn-js/no-blob-to-file": "error", @@ -268,9 +269,11 @@ "unicorn-js/no-uncalled-method": "error", "unicorn-js/no-undeclared-class-members": "error", "unicorn/no-unnecessary-array-flat-depth": "error", + "unicorn-js/no-unnecessary-array-flat-map": "error", "unicorn/no-unnecessary-array-splice-count": "error", "unicorn/no-unnecessary-await": "error", "unicorn-js/no-unnecessary-boolean-comparison": "error", + "unicorn-js/no-unnecessary-fetch-options": "error", "unicorn-js/no-unnecessary-global-this": "error", "unicorn-js/no-unnecessary-nested-ternary": "error", "unicorn-js/no-unnecessary-polyfills": "error", @@ -281,6 +284,7 @@ "unicorn/no-unreadable-iife": "error", "unicorn-js/no-unreadable-object-destructuring": "error", "unicorn-js/no-unsafe-buffer-conversion": "error", + "unicorn-js/no-unsafe-promise-all-settled-values": "error", "unicorn-js/no-unsafe-property-key": "error", "unicorn-js/no-unsafe-string-replacement": "error", "unicorn-js/no-unused-array-method-return": "error", @@ -309,6 +313,7 @@ // "unicorn/number-literal-case": "error", // "unicorn/numeric-separators-style": "error", "unicorn-js/operator-assignment": "error", + "unicorn-js/prefer-abort-signal-any": "error", "unicorn-js/prefer-abort-signal-timeout": "error", "unicorn/prefer-add-event-listener": "error", "unicorn-js/prefer-add-event-listener-options": "error", @@ -318,6 +323,7 @@ "unicorn/prefer-array-flat-map": "error", "unicorn-js/prefer-array-from-async": "error", "unicorn-js/prefer-array-from-map": "error", + "unicorn-js/prefer-array-from-range": "error", "unicorn/prefer-array-index-of": "error", "unicorn-js/prefer-array-iterable-methods": "error", "unicorn-js/prefer-array-last-methods": "error", @@ -327,6 +333,7 @@ "unicorn-js/prefer-await": "error", "unicorn/prefer-bigint-literals": "error", "unicorn/prefer-blob-reading-methods": "error", + "unicorn-js/prefer-block-statement-over-iife": "error", "unicorn-js/prefer-boolean-return": "error", "unicorn/prefer-class-fields": "error", "unicorn/prefer-classlist-toggle": "error", @@ -348,6 +355,7 @@ "unicorn-js/prefer-get-or-insert-computed": "error", "unicorn-js/prefer-global-number-constants": "error", // "unicorn/prefer-global-this": "error", + "unicorn-js/prefer-group-by": "error", "unicorn-js/prefer-has-check": "error", "unicorn-js/prefer-hoisting-branch-code": "error", // "unicorn-js/prefer-https": "error", @@ -355,6 +363,7 @@ "unicorn/prefer-includes": "error", "unicorn-js/prefer-includes-over-repeated-comparisons": "error", "unicorn-js/prefer-iterable-in-constructor": "error", + "unicorn-js/prefer-iterator-helpers": "error", "unicorn-js/prefer-iterator-to-array": "error", // "unicorn-js/prefer-iterator-to-array-at-end": "error", "unicorn/prefer-keyboard-event-key": "error", @@ -398,6 +407,7 @@ "unicorn-js/prefer-short-arrow-method": "warn", "unicorn-js/prefer-simple-condition-first": "error", "unicorn-js/prefer-simple-sort-comparator": "error", + "unicorn-js/prefer-simplified-conditions": "error", "unicorn-js/prefer-single-array-predicate": "error", "unicorn/prefer-single-call": "error", "unicorn-js/prefer-single-object-destructuring": "error", diff --git a/lib/routes/4chan/utils.tsx b/lib/routes/4chan/utils.tsx index 7ad52002c..171079b2d 100644 --- a/lib/routes/4chan/utils.tsx +++ b/lib/routes/4chan/utils.tsx @@ -35,7 +35,7 @@ const processCatalog = ({ data, board, viewOptions }: { data: CatalogApiReturn; return false; } - return !(viewOptions.maxReplies !== undefined && replies > viewOptions.maxReplies); + return viewOptions.maxReplies === undefined || replies <= viewOptions.maxReplies; }) .map((thread) => ({ author: `${thread.name} ${thread.trip ?? thread.no}`, diff --git a/lib/routes/bilibili/wasm-exec.ts b/lib/routes/bilibili/wasm-exec.ts index 6c914e9db..6159de0ac 100644 --- a/lib/routes/bilibili/wasm-exec.ts +++ b/lib/routes/bilibili/wasm-exec.ts @@ -7,6 +7,7 @@ // oxlint-disable unicorn-js/prefer-array-from-map // oxlint-disable unicorn-js/require-array-sort-compare // oxlint-disable unicorn-js/prefer-short-arrow-method +// oxlint-disable unicorn-js/prefer-block-statement-over-iife // oxlint-disable no-unused-vars // oxlint-disable unicorn/consistent-function-scoping /* eslint-disable prefer-rest-params */ diff --git a/lib/routes/f95zone/utils.ts b/lib/routes/f95zone/utils.ts index 8b96600a4..5af9178fb 100644 --- a/lib/routes/f95zone/utils.ts +++ b/lib/routes/f95zone/utils.ts @@ -38,7 +38,7 @@ export const processContent = (html: string): string => { while (changed) { changed = false; $('*').each((_, el) => { - if (!(el.type === 'tag' && !ALLOWED_TAGS.has(el.name))) { + if (el.type !== 'tag' || ALLOWED_TAGS.has(el.name)) { return; } diff --git a/lib/routes/follow/profile.ts b/lib/routes/follow/profile.ts index 6d67374a4..879937d58 100644 --- a/lib/routes/follow/profile.ts +++ b/lib/routes/follow/profile.ts @@ -52,7 +52,7 @@ async function handler(ctx: Context): Promise { return { title: `${profile.data.name}'s subscriptions`, - item: (subscriptions.data.filter((i) => !isInbox(i) && !(isFeed(i) && !!i.feeds.errorAt)) as Array>).map((subscription) => { + item: (subscriptions.data.filter((i) => !isInbox(i) && (!isFeed(i) || !i.feeds.errorAt)) as Array>).map((subscription) => { if (isList(subscription)) { return { title: subscription.lists.title, diff --git a/lib/routes/sigsac/ccs.ts b/lib/routes/sigsac/ccs.ts index 3074edd24..853365117 100644 --- a/lib/routes/sigsac/ccs.ts +++ b/lib/routes/sigsac/ccs.ts @@ -30,6 +30,9 @@ async function handler() { const urlList = yearResponses .map((response, i) => { + if (response.status !== 'fulfilled') { + return; + } const $ = load(response.value); const href = $('a:contains("Accepted Papers")').attr('href'); return href && new URL($('a:contains("Accepted Papers")').attr('href')!, yearList[i]).href; @@ -39,6 +42,9 @@ async function handler() { const responses = await Promise.allSettled(urlList.map((url) => ofetch(url))); const items = responses.flatMap((response, i) => { + if (response.status !== 'fulfilled') { + return []; + } const $ = load(response.value); const link = urlList[i]; const paperSection = $('div.papers-item') diff --git a/package.json b/package.json index fc0a43a91..a1d32618d 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "eslint-plugin-n": "18.2.1", "eslint-plugin-regexp": "3.1.1", "eslint-plugin-simple-import-sort": "13.0.0", - "eslint-plugin-unicorn": "69.0.0", + "eslint-plugin-unicorn": "70.0.0", "eslint-plugin-yml": "3.5.0", "fast-string-width": "3.0.2", "fs-extra": "11.3.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc14c014c..f761a9141 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -387,8 +387,8 @@ importers: specifier: 13.0.0 version: 13.0.0(eslint@10.6.0(jiti@2.6.1)) eslint-plugin-unicorn: - specifier: 69.0.0 - version: 69.0.0(eslint@10.6.0(jiti@2.6.1)) + specifier: 70.0.0 + version: 70.0.0(eslint@10.6.0(jiti@2.6.1)) eslint-plugin-yml: specifier: 3.5.0 version: 3.5.0(eslint@10.6.0(jiti@2.6.1)) @@ -2937,8 +2937,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001799: - resolution: {integrity: sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==} + caniuse-lite@1.0.30001800: + resolution: {integrity: sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==} caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -3300,8 +3300,8 @@ packages: engines: {node: '>=20'} hasBin: true - electron-to-chromium@1.5.381: - resolution: {integrity: sha512-n9Wa6yB+vDsGuA8AKbl/0z7HbvWqt5jxIdvr1IUicd0ryPrk7/xzwqLv8D9AbbvZ6avVNtXYLTfmgFHkwkyelg==} + electron-to-chromium@1.5.384: + resolution: {integrity: sha512-g6KAKY1vkYsADvSPWvdJsuYT0ixdcu6lUtD9P/wJKGBEDlZVXh2AX42j1mPqqaQPDluWjara9ziQ7xqAeXCt5A==} emoji-regex@10.6.0: resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} @@ -3459,8 +3459,8 @@ packages: peerDependencies: eslint: '>=5.0.0' - eslint-plugin-unicorn@69.0.0: - resolution: {integrity: sha512-ZN/KtHr9hQ6AOByANSNJpsDbo/+Nn+EyQ6blK4w+dcmS/xpYkqLLfrUc+NA/wOK6vF5uEUvhn8my5B/3sruB9g==} + eslint-plugin-unicorn@70.0.0: + resolution: {integrity: sha512-uAF9xMcVvvhTfvusCgogJ1wh4To3q2KhVMw3i1Apf/ILTbxsCjscvraAZACsEurb7no2fdXblD3whcbVnjw5zg==} engines: {node: '>=22'} peerDependencies: eslint: '>=10.4' @@ -7960,8 +7960,8 @@ snapshots: browserslist@4.28.4: dependencies: baseline-browser-mapping: 2.10.40 - caniuse-lite: 1.0.30001799 - electron-to-chromium: 1.5.381 + caniuse-lite: 1.0.30001800 + electron-to-chromium: 1.5.384 node-releases: 2.0.50 update-browserslist-db: 1.2.3(browserslist@4.28.4) @@ -8011,7 +8011,7 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001799: {} + caniuse-lite@1.0.30001800: {} caseless@0.12.0: {} @@ -8331,7 +8331,7 @@ snapshots: minimatch: 10.2.5 semver: 7.8.5 - electron-to-chromium@1.5.381: {} + electron-to-chromium@1.5.384: {} emoji-regex@10.6.0: {} @@ -8537,7 +8537,7 @@ snapshots: dependencies: eslint: 10.6.0(jiti@2.6.1) - eslint-plugin-unicorn@69.0.0(eslint@10.6.0(jiti@2.6.1)): + eslint-plugin-unicorn@70.0.0(eslint@10.6.0(jiti@2.6.1)): dependencies: '@babel/helper-validator-identifier': 7.29.7 '@eslint-community/eslint-utils': 4.9.1(eslint@10.6.0(jiti@2.6.1))