From 940ff14f3c025edbcbb0ecfbbff998ec172742cd Mon Sep 17 00:00:00 2001 From: Tachibana Shin Date: Tue, 10 Oct 2023 13:32:45 +0000 Subject: [PATCH] lint --- .eslintrc.js | 2 +- npm/raiku-pgs/lib/plugin/parseAnchor.ts | 2 +- .../lib/thread/create-worker-plugin.ts | 2 +- npm/raiku-pgs/lib/thread/exec-package-mjs.ts | 2 +- package.json | 11 ++--- pnpm-lock.yaml | 41 ++++++++----------- quasar.config.ts | 2 +- scripts/bumpp-android.ts | 8 ++-- scripts/bumpp-ios.ts | 6 +-- src/boot/i18n.ts | 3 +- src/components/PluginAddDialog.vue | 2 +- src/components/app/AppHeaderSearchMB.vue | 2 +- .../library/_components/DialogDLManga.vue | 2 +- src/components/truyen-tranh/ListChapters.vue | 4 +- .../truyen-tranh/ep/BtnDownload.vue | 2 +- .../truyen-tranh/readers/ReaderHorizontal.vue | 2 +- .../readers/__components__/PageView.vue | 2 +- src/injecters/user-auth.ts | 2 +- src/logic/bus.ts | 2 +- src/logic/download-manager.spec.ts | 24 +++++------ src/logic/download-manager.ts | 2 +- src/logic/formatView.ts | 2 +- src/logic/sakura.ts | 2 +- src/logic/to-type.ts | 2 +- src/logic/with-cache.spec.ts | 2 +- src/pages/app/settings/check-network.vue | 2 +- src/pages/app/sign-in.vue | 2 +- src/pages/genre/[[type]].vue | 2 +- src/pages/index.vue | 6 +-- src/pages/search.vue | 10 ++--- .../~[sourceId]/comic/[comic]/chap-[chap].vue | 2 +- src/router/index.ts | 2 +- src/stores/IDM.ts | 6 +-- src/stores/plugin.ts | 2 +- supabase/test/__tests__/history.test.ts | 4 +- 35 files changed, 82 insertions(+), 89 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 1ed8d76f..414b6927 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,7 +30,6 @@ module.exports = { // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage // ESLint typescript rules "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", "@tachibana-shin/eslint-config", // Uncomment any of the lines below to choose desired strictness, // but leave only one uncommented! @@ -105,6 +104,7 @@ module.exports = { "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-floating-promises": "error", "no-void": [ "error", { diff --git a/npm/raiku-pgs/lib/plugin/parseAnchor.ts b/npm/raiku-pgs/lib/plugin/parseAnchor.ts index 369e150f..f7204630 100644 --- a/npm/raiku-pgs/lib/plugin/parseAnchor.ts +++ b/npm/raiku-pgs/lib/plugin/parseAnchor.ts @@ -9,7 +9,7 @@ export function parseAnchor( readonly path: string readonly name: string } { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const path = parsePath(anchor.attr("href")!)! const name = anchor.text().trim() diff --git a/npm/raiku-pgs/lib/thread/create-worker-plugin.ts b/npm/raiku-pgs/lib/thread/create-worker-plugin.ts index 162ad883..aa95489e 100644 --- a/npm/raiku-pgs/lib/thread/create-worker-plugin.ts +++ b/npm/raiku-pgs/lib/thread/create-worker-plugin.ts @@ -52,7 +52,7 @@ class WorkerSession { // setup port const codeWorker = `${ this.devMode ? this.code : `!(()=>{${this.code}})()` - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + };${appendWorkerPluginMjs.replace(/process\.env\.DEV/g, this.devMode + "")}` // eslint-disable-next-line n/no-unsupported-features/node-builtins const url = URL.createObjectURL( diff --git a/npm/raiku-pgs/lib/thread/exec-package-mjs.ts b/npm/raiku-pgs/lib/thread/exec-package-mjs.ts index 46cb29d8..3380d9fe 100644 --- a/npm/raiku-pgs/lib/thread/exec-package-mjs.ts +++ b/npm/raiku-pgs/lib/thread/exec-package-mjs.ts @@ -8,7 +8,7 @@ export async function execPackageMjs(code: string, devMode: boolean) { // setup port const codeWorker = `${ devMode ? code : `!(()=>{${code}})()` - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + };${appendWorkerExecPackageMjs.replace(/process\.env\.DEV/g, devMode + "")}` // eslint-disable-next-line n/no-unsupported-features/node-builtins const url = URL.createObjectURL( diff --git a/package.json b/package.json index 16054992..86b171f5 100644 --- a/package.json +++ b/package.json @@ -67,14 +67,14 @@ "@vueuse/router": "^10.4.1", "@vueuse/shared": "^10.2.1", "cheerio": "1.0.0-rc.12", - "client-ext-animevsub-helper": "^1.0.16", + "client-ext-animevsub-helper": "^1.0.4", "dayjs": "^1.11.9", "eruda2": "0.0.2-b8", "fetch-retry": "^5.0.6", "hash-sum": "^2.0.0", "htmlparser2": "^9.0.0", "idb-keyval": "^6.2.0", - "iso-639-1": "^3.1.0", + "iso-639-1": "^2.1.15", "js-base64": "^3.7.4", "js-cookie": "^3.0.5", "modern-async": "^1.1.3", @@ -113,7 +113,7 @@ "@intlify/vite-plugin-vue-i18n": "^6.0.3", "@pinia/testing": "^0.1.3", "@quasar/app-vite": "^1.4.3", - "@quasar/cli": "^2.3.0", + "@quasar/cli": "^2.2.3", "@quasar/icongenie": "^3.1.1", "@quasar/quasar-app-extension-testing-e2e-cypress": "^5.1.1", "@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0", @@ -125,7 +125,7 @@ "@types/js-cookie": "^3.0.3", "@types/lz-string": "^1.3.34", "@types/node": "18.8.0", - "@types/prompts": "^2.4.5", + "@types/prompts": "^2.4.2", "@types/semver": "^7.3.13", "@types/serviceworker": "^0.0.67", "@types/set-cookie-parser": "^2.4.3", @@ -179,7 +179,7 @@ "workbox-cacheable-response": "^7.0.0", "workbox-core": "^6.5.0", "workbox-expiration": "^7.0.0", - "workbox-precaching": "^7.0.0", + "workbox-precaching": "^6.5.0", "workbox-routing": "^6.5.0", "workbox-strategies": "^7.0.0" }, @@ -196,3 +196,4 @@ "targets": {} } } + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e57f9d3e..f5d72cbc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,7 +66,7 @@ importers: specifier: 1.0.0-rc.12 version: 1.0.0-rc.12 client-ext-animevsub-helper: - specifier: ^1.0.16 + specifier: ^1.0.4 version: 1.0.16 dayjs: specifier: ^1.11.9 @@ -87,8 +87,8 @@ importers: specifier: ^6.2.0 version: 6.2.0 iso-639-1: - specifier: ^3.1.0 - version: 3.1.0 + specifier: ^2.1.15 + version: 2.1.15 js-base64: specifier: ^3.7.4 version: 3.7.4 @@ -199,7 +199,7 @@ importers: specifier: ^1.4.3 version: 1.4.3(eslint@8.33.0)(pinia@2.0.29)(quasar@2.12.2)(rollup@2.77.3)(vue-router@4.2.5)(vue@3.2.45)(workbox-build@6.6.0) '@quasar/cli': - specifier: ^2.3.0 + specifier: ^2.2.3 version: 2.3.0 '@quasar/icongenie': specifier: ^3.1.1 @@ -235,7 +235,7 @@ importers: specifier: 18.8.0 version: 18.8.0 '@types/prompts': - specifier: ^2.4.5 + specifier: ^2.4.2 version: 2.4.5 '@types/semver': specifier: ^7.3.13 @@ -397,8 +397,8 @@ importers: specifier: ^7.0.0 version: 7.0.0 workbox-precaching: - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^6.5.0 + version: 6.6.0 workbox-routing: specifier: ^6.5.0 version: 6.6.0 @@ -5518,6 +5518,10 @@ packages: /@types/semver@7.3.13: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} + dev: true + + /@types/semver@7.5.3: + resolution: {integrity: sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==} /@types/send@0.17.1: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} @@ -5817,6 +5821,7 @@ packages: transitivePeerDependencies: - supports-color - typescript + dev: true /@typescript-eslint/utils@5.62.0(eslint@8.33.0)(typescript@5.0.4): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -5826,7 +5831,7 @@ packages: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.33.0) '@types/json-schema': 7.0.13 - '@types/semver': 7.3.13 + '@types/semver': 7.5.3 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.0.4) @@ -9650,7 +9655,7 @@ packages: optional: true dependencies: '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.61.0)(eslint@8.33.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.61.0(eslint@8.33.0)(typescript@5.0.4) + '@typescript-eslint/utils': 5.62.0(eslint@8.33.0)(typescript@5.0.4) eslint: 8.33.0 transitivePeerDependencies: - supports-color @@ -11715,8 +11720,8 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /iso-639-1@3.1.0: - resolution: {integrity: sha512-rWcHp9dcNbxa5C8jA/cxFlWNFNwy5Vup0KcFvgA8sPQs9ZeJHj/Eq0Y8Yz2eL8XlWYpxw4iwh9FfTeVxyqdRMw==} + /iso-639-1@2.1.15: + resolution: {integrity: sha512-7c7mBznZu2ktfvyT582E2msM+Udc1EjOyhVRE/0ZsjD9LBtWSm23h3PtiRh2a35XoUsTQQjJXaJzuLjXsOdFDg==} engines: {node: '>=6.0'} dev: false @@ -16896,14 +16901,6 @@ packages: workbox-routing: 6.6.0 workbox-strategies: 6.6.0 - /workbox-precaching@7.0.0: - resolution: {integrity: sha512-EC0vol623LJqTJo1mkhD9DZmMP604vHqni3EohhQVwhJlTgyKyOkMrZNy5/QHfOby+39xqC01gv4LjOm4HSfnA==} - dependencies: - workbox-core: 7.0.0 - workbox-routing: 7.0.0 - workbox-strategies: 7.0.0 - dev: true - /workbox-range-requests@6.6.0: resolution: {integrity: sha512-V3aICz5fLGq5DpSYEU8LxeXvsT//mRWzKrfBOIxzIdQnV/Wj7R+LyJVTczi4CQ4NwKhAaBVaSujI1cEjXW+hTw==} dependencies: @@ -16924,12 +16921,6 @@ packages: dependencies: workbox-core: 6.6.0 - /workbox-routing@7.0.0: - resolution: {integrity: sha512-8YxLr3xvqidnbVeGyRGkaV4YdlKkn5qZ1LfEePW3dq+ydE73hUUJJuLmGEykW3fMX8x8mNdL0XrWgotcuZjIvA==} - dependencies: - workbox-core: 7.0.0 - dev: true - /workbox-strategies@6.6.0: resolution: {integrity: sha512-eC07XGuINAKUWDnZeIPdRdVja4JQtTuc35TZ8SwMb1ztjp7Ddq2CJ4yqLvWzFWGlYI7CG/YGqaETntTxBGdKgQ==} dependencies: diff --git a/quasar.config.ts b/quasar.config.ts index bf852bd3..2db238bc 100644 --- a/quasar.config.ts +++ b/quasar.config.ts @@ -110,7 +110,7 @@ export default configure((/* ctx */) => { } : process.env.CODESPACE_NAME ? { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + host: `${process.env.CODESPACE_NAME}-9000.${process.env .GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN!}`, protocol: "wss", diff --git a/scripts/bumpp-android.ts b/scripts/bumpp-android.ts index b6e1cb85..9f3e07f5 100644 --- a/scripts/bumpp-android.ts +++ b/scripts/bumpp-android.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/restrict-template-expressions */ + import { spawnSync } from "child_process" import { readFileSync, writeFileSync } from "fs" @@ -32,7 +32,7 @@ async function bumppAndroid() { const _t1 = buildGradle.slice(indexVersionCode + 11) const currentVersionCode = parseInt(_t1.slice(0, _t1.indexOf("\n")).trim()) const _t2 = buildGradle.slice(indexVersionName + 11) - // eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval + // eslint-disable-next-line no-new-func const currentVersionName = new Function( "return " + _t2.slice(0, _t2.indexOf("\n")).trim() )() @@ -93,9 +93,9 @@ async function bumppAndroid() { const value = name === "next" ? semver.parse(currentVersionName)?.prerelease?.length - ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + ? semver.inc(currentVersionName, "prerelease")! - : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + : semver.inc(currentVersionName, "patch")! : new SemVer(currentVersionName).inc(name) diff --git a/scripts/bumpp-ios.ts b/scripts/bumpp-ios.ts index 48318ea8..f0ba8539 100644 --- a/scripts/bumpp-ios.ts +++ b/scripts/bumpp-ios.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/restrict-template-expressions */ + import { spawnSync } from "child_process" import { readFileSync, writeFileSync } from "fs" import { resolve } from "path" @@ -100,9 +100,9 @@ async function bumppiOS() { const value = name === "next" ? semver.parse(currentVersionName)?.prerelease?.length - ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + ? semver.inc(currentVersionName, "prerelease")! - : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + : semver.inc(currentVersionName, "patch")! : new SemVer(currentVersionName).inc(name) diff --git a/src/boot/i18n.ts b/src/boot/i18n.ts index 5aab9f3f..808aeb7d 100644 --- a/src/boot/i18n.ts +++ b/src/boot/i18n.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-empty-interface */ import { boot } from "quasar/wrappers" import { loadLocalize } from "src/i18n" import enUS from "src/i18n/messages/en-US.json" @@ -7,7 +8,7 @@ import type { Ref } from "vue" import { watch } from "vue" import { createI18n } from "vue-i18n" -/* eslint-disable @typescript-eslint/no-empty-interface */ + declare module "vue-i18n" { // define the datetime format schema export interface DefineDateTimeFormat {} diff --git a/src/components/PluginAddDialog.vue b/src/components/PluginAddDialog.vue index 4c5bf6a2..438322af 100644 --- a/src/components/PluginAddDialog.vue +++ b/src/components/PluginAddDialog.vue @@ -105,7 +105,7 @@ async function addPlugin() { break default: message = t("loi-khi-them-plugin", [ - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + import.meta.env.DEV ? ` (${err})` : "" ]) } diff --git a/src/components/app/AppHeaderSearchMB.vue b/src/components/app/AppHeaderSearchMB.vue index 247e9f61..34da007e 100644 --- a/src/components/app/AppHeaderSearchMB.vue +++ b/src/components/app/AppHeaderSearchMB.vue @@ -130,7 +130,7 @@ const allPlugins = computed(() => const keyword = ref("") -// eslint-disable-next-line @typescript-eslint/restrict-plus-operands + const query = ref((route.query.query ?? "") + "") const { data: searchResult, runAsync } = useRequest( () => { diff --git a/src/components/library/_components/DialogDLManga.vue b/src/components/library/_components/DialogDLManga.vue index 355cb2b9..c8b95728 100644 --- a/src/components/library/_components/DialogDLManga.vue +++ b/src/components/library/_components/DialogDLManga.vue @@ -333,7 +333,7 @@ watch(showDownloadMore, async (state) => { allEp.value = episodes } catch (err) { $q.notify({ - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + message: err + "" }) } diff --git a/src/components/truyen-tranh/ListChapters.vue b/src/components/truyen-tranh/ListChapters.vue index d433bc6e..14a2fe42 100644 --- a/src/components/truyen-tranh/ListChapters.vue +++ b/src/components/truyen-tranh/ListChapters.vue @@ -166,7 +166,7 @@ const segments = computed(() => { return unflat(props.chapters, 50).map((items) => { const [from, to] = [ parseFloat(normalizeChName(items[0].name)), - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + parseFloat(normalizeChName(items.at(-1)!.name)) ] @@ -233,7 +233,7 @@ async function downloadEp(item: Chapter) { false ) - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const task = await IDMStore.download(props.metaManga!, { ep_id: item.id, ep_name: item.name, diff --git a/src/components/truyen-tranh/ep/BtnDownload.vue b/src/components/truyen-tranh/ep/BtnDownload.vue index 6b0dc482..a48db1a2 100644 --- a/src/components/truyen-tranh/ep/BtnDownload.vue +++ b/src/components/truyen-tranh/ep/BtnDownload.vue @@ -80,7 +80,7 @@ function onClickDownload() { noCaps: true, flat: true } - // eslint-disable-next-line @typescript-eslint/no-misused-promises + }).onOk(async () => { if (props.mangaId !== null && props.epId !== null) await deleteEpisode(props.mangaId, props.epId) diff --git a/src/components/truyen-tranh/readers/ReaderHorizontal.vue b/src/components/truyen-tranh/readers/ReaderHorizontal.vue index c7d77e96..2a2d0121 100644 --- a/src/components/truyen-tranh/readers/ReaderHorizontal.vue +++ b/src/components/truyen-tranh/readers/ReaderHorizontal.vue @@ -145,7 +145,7 @@ const sizePage = computed(() => { return Math.ceil( props.pages.reduce((prev, item, index) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain + // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain if (sizes.get(index)?.[0]! > 1_200) prev += 2 else prev += 0.5 diff --git a/src/components/truyen-tranh/readers/__components__/PageView.vue b/src/components/truyen-tranh/readers/__components__/PageView.vue index 86048a87..4586b93c 100644 --- a/src/components/truyen-tranh/readers/__components__/PageView.vue +++ b/src/components/truyen-tranh/readers/__components__/PageView.vue @@ -64,7 +64,7 @@ watch(srcImage, (n, o) => { if (o?.startsWith("blob:")) URL.revokeObjectURL(o) }) function onLoad(event: Event) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + emit("load", event.target as HTMLImageElement, intersection.value!) const { src } = event.target as HTMLImageElement if (src.startsWith("blob:")) URL.revokeObjectURL(src) diff --git a/src/injecters/user-auth.ts b/src/injecters/user-auth.ts index a3b338fb..4cac4793 100644 --- a/src/injecters/user-auth.ts +++ b/src/injecters/user-auth.ts @@ -2,7 +2,7 @@ import { copyToClipboard } from "src/logic/copy-to-clipboard" import { encryptText } from "src/logic/cryper" -// eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-misused-promises +// eslint-disable-next-line no-unused-expressions !(async () => { const user_auth = localStorage.getItem("user-auth") diff --git a/src/logic/bus.ts b/src/logic/bus.ts index 4e6e6280..5ef3f28a 100644 --- a/src/logic/bus.ts +++ b/src/logic/bus.ts @@ -12,7 +12,7 @@ export class EventBus> { if (!(name in this.events)) this.events[name] = new Set<(...args: unknown[]) => void>() - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.events[name]!.add(cb) if (instance) onBeforeUnmount(() => this.off(name, cb), instance) diff --git a/src/logic/download-manager.spec.ts b/src/logic/download-manager.spec.ts index 85be40b2..39c984fa 100644 --- a/src/logic/download-manager.spec.ts +++ b/src/logic/download-manager.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/restrict-plus-operands */ + /* eslint-disable camelcase */ import hashSum from "hash-sum" import { cleanup, exists, readdir, readFile } from "test/vitest/utils" @@ -53,11 +53,11 @@ function patchFetch() { async (url: string) => { await sleep(100) return Promise.resolve({ - // eslint-disable-next-line @typescript-eslint/require-await + async arrayBuffer() { return new TextEncoder().encode(url) }, - // eslint-disable-next-line @typescript-eslint/require-await + async text() { return url } @@ -115,7 +115,7 @@ describe("download-manager", () => { ]) // valid image pages - // eslint-disable-next-line @typescript-eslint/no-for-in-array + for (const index in pages) { const path = `files/${hashIDManga}/${hashIDEp}/${hashSum(+index)}` @@ -170,11 +170,11 @@ describe("download-manager", () => { if (counter++ > 5) return Promise.reject(new Error("time_out")) return Promise.resolve({ - // eslint-disable-next-line @typescript-eslint/require-await + async arrayBuffer() { return new TextEncoder().encode(url) }, - // eslint-disable-next-line @typescript-eslint/require-await + async text() { return url } @@ -201,7 +201,7 @@ describe("download-manager", () => { ]) // valid image page - // eslint-disable-next-line @typescript-eslint/no-for-in-array + for (const index in pages.slice(0, 5)) { const path = `files/${hashIDManga}/${hashIDEp}/${hashSum(+index)}` @@ -244,11 +244,11 @@ describe("download-manager", () => { if (counter++ > 5) return Promise.reject(new Error("time_out")) return Promise.resolve({ - // eslint-disable-next-line @typescript-eslint/require-await + async arrayBuffer() { return new TextEncoder().encode(url) }, - // eslint-disable-next-line @typescript-eslint/require-await + async text() { return url } @@ -276,7 +276,7 @@ describe("download-manager", () => { ]) // valid image page - // eslint-disable-next-line @typescript-eslint/no-for-in-array + for (const index in pages.slice(0, 5)) { const path = `files/${hashIDManga}/${hashIDEp}/${hashSum(+index)}` @@ -332,7 +332,7 @@ describe("download-manager", () => { ]) // valid image pages - // eslint-disable-next-line @typescript-eslint/no-for-in-array + for (const index in pages) { const path = `files/${hashIDManga}/${hashIDEp}/${hashSum(+index)}` @@ -411,7 +411,7 @@ describe("download-manager", () => { ]) // valid image pages - // eslint-disable-next-line @typescript-eslint/no-for-in-array + for (const index in pages) { const path = `files/${hashIDManga}/${hashIDEp}/${hashSum(+index)}` diff --git a/src/logic/download-manager.ts b/src/logic/download-manager.ts index 58beb00f..68336b05 100644 --- a/src/logic/download-manager.ts +++ b/src/logic/download-manager.ts @@ -159,7 +159,7 @@ export function createTaskDownloadEpisode( // delay 1s clearTimeout(timeout) - // eslint-disable-next-line @typescript-eslint/no-misused-promises + timeout = setTimeout(async () => { try { await Filesystem.writeFile({ diff --git a/src/logic/formatView.ts b/src/logic/formatView.ts index 473817e2..26e0d7bf 100644 --- a/src/logic/formatView.ts +++ b/src/logic/formatView.ts @@ -1,7 +1,7 @@ const levels = ["N", "Tr", "T", "V"] export function formatView(view: number): string { - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + if (view < 1000) return view + "" const index = levels.findIndex(() => { view /= 1000 diff --git a/src/logic/sakura.ts b/src/logic/sakura.ts index cbd444e1..68f69820 100644 --- a/src/logic/sakura.ts +++ b/src/logic/sakura.ts @@ -125,7 +125,7 @@ function createSakura(x1: number, y1: number, x2: number, y2: number): Sakura { export function useSakura(element: HTMLCanvasElement) { const sakura = new Set() - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const ctx = element.getContext("2d")! let stopped = false diff --git a/src/logic/to-type.ts b/src/logic/to-type.ts index 7dd5afc3..992070de 100644 --- a/src/logic/to-type.ts +++ b/src/logic/to-type.ts @@ -1,4 +1,4 @@ -// eslint-disable-next-line @typescript-eslint/unbound-method + const { toString } = Object.prototype // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/logic/with-cache.spec.ts b/src/logic/with-cache.spec.ts index e772cce4..3238a52a 100644 --- a/src/logic/with-cache.spec.ts +++ b/src/logic/with-cache.spec.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/require-await */ + import { expect } from "vitest" const value = { v: Math.random() } diff --git a/src/pages/app/settings/check-network.vue b/src/pages/app/settings/check-network.vue index 1fbd95f6..6bf4f354 100644 --- a/src/pages/app/settings/check-network.vue +++ b/src/pages/app/settings/check-network.vue @@ -113,7 +113,7 @@ const IP = computedAsync(() => { return fetch("https://freeipapi.com/api/json") .then((res) => res.json()) .then((res) => { - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + return `${res.ipAddress} - ${res.regionName} (${res.countryName})` }) }) diff --git a/src/pages/app/sign-in.vue b/src/pages/app/sign-in.vue index ecaee135..3cfb10c5 100644 --- a/src/pages/app/sign-in.vue +++ b/src/pages/app/sign-in.vue @@ -247,7 +247,7 @@ async function login() { data.user.user_metadata.name ?? data.user.email ]) }) - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + void router.push((route.query.redirectTo ?? "/") + "") } diff --git a/src/pages/genre/[[type]].vue b/src/pages/genre/[[type]].vue index 0977a9a2..f3dcb335 100644 --- a/src/pages/genre/[[type]].vue +++ b/src/pages/genre/[[type]].vue @@ -69,7 +69,7 @@ const paramSourceId = useRouteParams("sourceId", undefined, { const page = computed({ get: () => parseInt(route.query.page?.toString() ?? "1") || 1, - // eslint-disable-next-line @typescript-eslint/no-misused-promises + set: (page) => router.push({ ...route, diff --git a/src/pages/index.vue b/src/pages/index.vue index f7b14898..0252a30f 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -423,7 +423,7 @@ meta: