diff --git a/eslint.config.js b/eslint.config.js index 12097d2..5e63f6a 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -22,7 +22,9 @@ export default tseslint.config( 'import/order': ['error', { 'newlines-between': 'always', groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'] - }] + }], + '@typescript-eslint/no-unnecessary-condition': 'warn', + '@typescript-eslint/no-unused-vars': 'off' } } ) diff --git a/src/lib/components/Backplate.svelte b/src/lib/components/Backplate.svelte index 8554bbf..60b1cc2 100644 --- a/src/lib/components/Backplate.svelte +++ b/src/lib/components/Backplate.svelte @@ -20,7 +20,6 @@ isAnimating = true isFlying = true await sleep(800) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (!isFlying) return isSpinning = true isFlying = false diff --git a/src/lib/components/KeepAlive.svelte b/src/lib/components/KeepAlive.svelte index be0bde8..59f0c89 100644 --- a/src/lib/components/KeepAlive.svelte +++ b/src/lib/components/KeepAlive.svelte @@ -27,7 +27,7 @@ export let id: string - // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars + // eslint-disable-next-line no-unused-vars type $$Props = HTMLAttributes & { id: string } function mount (node: HTMLDivElement) { diff --git a/src/lib/components/SearchModal.svelte b/src/lib/components/SearchModal.svelte index efc8105..b280bc2 100644 --- a/src/lib/components/SearchModal.svelte +++ b/src/lib/components/SearchModal.svelte @@ -140,7 +140,6 @@ $: searchResult && startAnimation(searchResult) -
diff --git a/src/lib/components/ui/button/progress-button.svelte b/src/lib/components/ui/button/progress-button.svelte index 21d495a..b124f01 100644 --- a/src/lib/components/ui/button/progress-button.svelte +++ b/src/lib/components/ui/button/progress-button.svelte @@ -26,7 +26,6 @@ animating = false } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (autoStart) startAnimation() function handleAnimationEnd () { diff --git a/src/lib/components/ui/dialog/dialog-portal.svelte b/src/lib/components/ui/dialog/dialog-portal.svelte index 3abce22..c26a23c 100644 --- a/src/lib/components/ui/dialog/dialog-portal.svelte +++ b/src/lib/components/ui/dialog/dialog-portal.svelte @@ -1,7 +1,7 @@ diff --git a/src/lib/components/ui/player/util.ts b/src/lib/components/ui/player/util.ts index 8cc49b1..5809b3c 100644 --- a/src/lib/components/ui/player/util.ts +++ b/src/lib/components/ui/player/util.ts @@ -158,7 +158,6 @@ export function normalizeTracks (_tracks: Track[]) { const hasEng = tracks.some(track => track.language === 'eng' || track.language === 'en') const lang = tracks.map(({ id, language, label, enabled, selected }) => { return { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition enabled: enabled ?? selected, id, language: language || !hasEng ? 'eng' : 'unk', diff --git a/src/lib/modules/extensions/extensions.ts b/src/lib/modules/extensions/extensions.ts index ff92c9b..8aad38f 100644 --- a/src/lib/modules/extensions/extensions.ts +++ b/src/lib/modules/extensions/extensions.ts @@ -205,14 +205,12 @@ export const extensions = new class Extensions { ? entry.accuracy : dupe.accuracy) dupe.title = entry.title.length > dupe.title.length ? entry.title : dupe.title - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition dupe.link ??= entry.link dupe.id ??= entry.id dupe.seeders ||= entry.seeders >= 30000 ? 0 : entry.seeders dupe.leechers ||= entry.leechers >= 30000 ? 0 : entry.leechers dupe.downloads ||= entry.downloads dupe.size ||= entry.size - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition dupe.date ||= entry.date dupe.type ??= entry.type === 'best' ? 'best' : entry.type === 'alt' ? 'alt' : entry.type } else { diff --git a/src/lib/modules/w2g/index.ts b/src/lib/modules/w2g/index.ts index 0a1352c..696a1a9 100644 --- a/src/lib/modules/w2g/index.ts +++ b/src/lib/modules/w2g/index.ts @@ -103,7 +103,6 @@ export class W2GClient extends EventEmitter { _playerStateChanged (state: PlayerState) { debug(`_playerStateChanged: ${this.player.paused} ${state.paused} ${this.player.time} ${state.time}`) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (!state) return false if (this.player.paused !== state.paused || this.player.time !== state.time) { this.player = state @@ -167,7 +166,6 @@ export class W2GClient extends EventEmitter { break case EventTypes.MagnetLinkEvent: { const cast = data as Event<{magnet: string, hash: string}> - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (cast.payload.magnet === undefined) break const { hash, magnet } = cast.payload if (hash !== this.magnet?.hash) { @@ -180,7 +178,6 @@ export class W2GClient extends EventEmitter { } case EventTypes.MediaIndexEvent: { const cast = data as Event<{index: number}> - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (cast.payload.index === undefined) break if (this.index !== cast.payload.index) { this.index = cast.payload.index @@ -190,7 +187,6 @@ export class W2GClient extends EventEmitter { } case EventTypes.PlayerStateEvent: { const cast = data as Event - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (cast.payload.time === undefined) break if (this._playerStateChanged(cast.payload)) this.emit('player', data.payload) break diff --git a/src/routes/app/settings/interface/+page.svelte b/src/routes/app/settings/interface/+page.svelte index 499397a..7b5b8a8 100644 --- a/src/routes/app/settings/interface/+page.svelte +++ b/src/routes/app/settings/interface/+page.svelte @@ -1,5 +1,4 @@