mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-11 22:15:35 +00:00
fix: cleanp some rules
This commit is contained in:
parent
b37b48922d
commit
db0b9b6b69
10 changed files with 5 additions and 14 deletions
|
|
@ -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'
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<HTMLDivElement> & { id: string }
|
||||
|
||||
function mount (node: HTMLDivElement) {
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@
|
|||
$: searchResult && startAnimation(searchResult)
|
||||
</script>
|
||||
|
||||
<!-- eslint-disable-next-line svelte/no-reactive-reassign -->
|
||||
<Dialog.Root bind:open onOpenChange={close} portal='#root'>
|
||||
<Dialog.Content class='bg-black h-full lg:border-x-4 border-b-0 max-w-5xl w-full max-h-[calc(100%-1rem)] mt-2 p-0 items-center flex lg:rounded-t-xl overflow-hidden'>
|
||||
<div class='absolute top-0 left-0 w-full h-full max-h-28 overflow-hidden'>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
animating = false
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (autoStart) startAnimation()
|
||||
|
||||
function handleAnimationEnd () {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script lang='ts'>
|
||||
import { Dialog as DialogPrimitive } from 'bits-ui'
|
||||
|
||||
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
type $$Props = DialogPrimitive.PortalProps
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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<PlayerState>
|
||||
// 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<script lang='ts' context='module'>
|
||||
// @ts-expect-error internal methods
|
||||
// eslint-disable-next-line svelte/no-svelte-internal
|
||||
import { append, element } from 'svelte/internal'
|
||||
import { persisted } from 'svelte-persisted-store'
|
||||
|
|
|
|||
Loading…
Reference in a new issue