Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Oct 10, 2023
1 parent c041c5b commit 940ff14
Show file tree
Hide file tree
Showing 35 changed files with 82 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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",
{
Expand Down
2 changes: 1 addition & 1 deletion npm/raiku-pgs/lib/plugin/parseAnchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion npm/raiku-pgs/lib/thread/create-worker-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion npm/raiku-pgs/lib/thread/exec-package-mjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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"
},
Expand All @@ -196,3 +196,4 @@
"targets": {}
}
}

41 changes: 16 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion quasar.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions scripts/bumpp-android.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */

import { spawnSync } from "child_process"
import { readFileSync, writeFileSync } from "fs"
Expand Down Expand Up @@ -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()
)()
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions scripts/bumpp-ios.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion src/boot/i18n.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 {}
Expand Down
2 changes: 1 addition & 1 deletion src/components/PluginAddDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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})` : ""
])
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/AppHeaderSearchMB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(
() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/library/_components/DialogDLManga.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ""
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/truyen-tranh/ListChapters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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))
]
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/truyen-tranh/ep/BtnDownload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/components/truyen-tranh/readers/ReaderHorizontal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/injecters/user-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion src/logic/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class EventBus<Events extends Record<string, unknown[]>> {
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)
Expand Down
Loading

0 comments on commit 940ff14

Please sign in to comment.