From 7099139ceb3916a3af1bd16cec90cb3dc9d2ab25 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Sun, 16 Nov 2025 20:35:06 +0800 Subject: [PATCH] style: lint --- apps/directory/src/routes/path/Home.jsx | 33 ++++++++++++------------ apps/showcase/src/components/voice.js | 13 +++++++--- packages/music/index.ts | 34 ++++++++++++------------- 3 files changed, 43 insertions(+), 37 deletions(-) diff --git a/apps/directory/src/routes/path/Home.jsx b/apps/directory/src/routes/path/Home.jsx index 864c59e..0e27006 100644 --- a/apps/directory/src/routes/path/Home.jsx +++ b/apps/directory/src/routes/path/Home.jsx @@ -120,7 +120,7 @@ export default function Home() { const list = navigationList.filter((item) => { return ( item.name.toLowerCase().indexOf(searchField.toLowerCase()) !== - -1 || item.type === 'date' + -1 || item.type === 'date' ) }) const newList = [] @@ -222,7 +222,7 @@ export default function Home() { } viewBox={ entry.type === - 'operator' + 'operator' ? '0 0 88.969 71.469' : '0 0 94.563 67.437' } @@ -234,24 +234,25 @@ export default function Home() { } > {language === - 'zh-CN' + 'zh-CN' ? entry.type === - 'skin' - ? `${entry - .skinName[ - 'zh-CN' - ] - } · ${entry.operatorName}` + 'skin' + ? `${ + entry + .skinName[ + 'zh-CN' + ] + } · ${entry.operatorName}` : entry.operatorName : entry - .skinName[ - 'en-US' - ]} + .skinName[ + 'en-US' + ]}
@@ -368,9 +369,9 @@ function OperatorElement({ item, hidden, handleVoicePlay }) { { item.codename[ - language.startsWith('en') - ? alternateLang - : textDefaultLang + language.startsWith('en') + ? alternateLang + : textDefaultLang ] } diff --git a/apps/showcase/src/components/voice.js b/apps/showcase/src/components/voice.js index c68d585..0647f46 100644 --- a/apps/showcase/src/components/voice.js +++ b/apps/showcase/src/components/voice.js @@ -95,7 +95,8 @@ export default class Voice { this.#default.language.voice = this.#voice.languages[0] this.#config.language = this.#default.language.voice this.#voice.locations = this.#getVoiceLocations() - this.#voice.list = this.#charwordTable.availability[this.#config.language] + this.#voice.list = + this.#charwordTable.availability[this.#config.language] } success() { @@ -206,7 +207,7 @@ export default class Voice { const content = subtitle.text const cvInfo = this.#charwordTable.voiceLangs[this.subtitleLanguage][ - this.#config.language + this.#config.language ] document.getElementById('voice-title').innerText = title document.getElementById('voice-subtitle').innerText = content @@ -251,7 +252,10 @@ export default class Voice { #nextVoice() { const getVoiceId = () => { - const id = this.#voice.list[Math.floor(Math.random() * this.#voice.list.length)] + const id = + this.#voice.list[ + Math.floor(Math.random() * this.#voice.list.length) + ] return id === this.#voice.id.last ? getVoiceId() : id } this.#playVoice(getVoiceId()) @@ -355,7 +359,8 @@ export default class Voice { this.#voice.list = this.#charwordTable.availability[lang] } else { this.#config.language = this.#default.language.voice - this.#voice.list = this.#charwordTable.availability[this.#config.language] + this.#voice.list = + this.#charwordTable.availability[this.#config.language] } const availableSubtitleLang = this.#getSubtitleLanguages() if (!availableSubtitleLang.includes(this.#config.subtitle.language)) { diff --git a/packages/music/index.ts b/packages/music/index.ts index 15b6d40..da2c4aa 100644 --- a/packages/music/index.ts +++ b/packages/music/index.ts @@ -58,7 +58,7 @@ const generateMapping = () => { }) let noCheck = false if (mode === 'update' || mode === 'download') { - noCheck = true + noCheck = true } const musicFolder = DATA_DIR const musicTableContent = file.readSync(MUSIC_TABLE_JSON) @@ -97,22 +97,22 @@ const generateMapping = () => { } if (!noCheck) { - for (const e of musicFiles) { - const musicPath = path.join(e.source, e.filename) - if (!file.exists(musicPath)) { - throw new Error( - `Music file ${e.filename} is not found in music folder.` - ) - } - } + for (const e of musicFiles) { + const musicPath = path.join(e.source, e.filename) + if (!file.exists(musicPath)) { + throw new Error( + `Music file ${e.filename} is not found in music folder.` + ) + } + } - for (const e of Object.keys(musicFileMapping)) { - if (!backgroundFiles.includes(e)) { - throw new Error( - `Background file ${e} is not found in background folder.` - ) - } - } + for (const e of Object.keys(musicFileMapping)) { + if (!backgroundFiles.includes(e)) { + throw new Error( + `Background file ${e} is not found in background folder.` + ) + } + } } return { @@ -130,7 +130,7 @@ export const update = async () => { const musicBankAlias = audioDataTable.bankAlias const musicData: MusicDataItem[] = metaTable.homeBackgroundData.homeBgDataList.reduce((acc, cur) => { - cur.multiFormList.forEach(item => { + cur.multiFormList.forEach((item) => { acc.push({ id: item.multiFormBgId, musicId: item.bgMusicId,