fix(ui): resolve lint errors surfaced by the new ESLint config

Use const for a never-reassigned local, drop an unused v-for index,
add a default branch to an exhaustive switch the linter cannot prove,
and remove eslint-disable directives that no longer match enabled rules.
This commit is contained in:
matevip 2026-07-15 14:26:27 +08:00
parent f97624874c
commit 6aad9fd945
6 changed files with 3 additions and 5 deletions

View File

@ -162,7 +162,6 @@ function onEditorMount(editor: monaco.editor.IStandaloneCodeEditor) {
// is needed because monaco's d.ts marks the static `languages.json`
// namespace as deprecated even though it's still the official runtime
// API for jsonDefaults.setDiagnosticsOptions in the v0.55.x line.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const jsonLang = (monaco.languages as any).json
if (jsonLang?.jsonDefaults) {
jsonLang.jsonDefaults.setDiagnosticsOptions({

View File

@ -132,7 +132,7 @@ export function useMessages(options: UseMessagesOptions = {}): UseMessagesReturn
if (!message) return
// 获取或创建对应类型的 contentPart
let contentParts = [...(message.contentParts || [])]
const contentParts = [...(message.contentParts || [])]
const partIndex = contentParts.findLastIndex(p => p.type === type)
if (partIndex === -1) {

View File

@ -53,7 +53,6 @@ const SKIP_TAGS = new Set(['PRE', 'CODE', 'KBD', 'SAMP'])
* when someone wrote them literally instead of as escape text. If a real slug
* needs a tab character, that is a backend bug worth surfacing.
*/
// eslint-disable-next-line no-control-regex
const DANGEROUS_CHAR_RE = /[<>"'`\n\r\x00-\x1F\x7F]/
/** Slug length cap. Backend `toSlug` produces slugs well under this. */

View File

@ -887,6 +887,7 @@ const modelPromptText = computed<{ title: string; desc: string }>(() => {
case 'unprobed':
return { title: t('chat.prompt.unprobed.title'), desc: t('chat.prompt.unprobed.desc') }
case 'no-models':
default:
return {
title: t('chat.prompt.noModels.title', { name: p?.name || '' }),
desc: t('chat.prompt.noModels.desc'),

View File

@ -16,7 +16,7 @@
</div>
<div class="stage-labels">
<div
v-for="(stage, idx) in stages"
v-for="stage in stages"
:key="stage.key"
class="stage-label-cell"
>

View File

@ -10,7 +10,6 @@
* The catalog entry's `iconKey` must match the basename.
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
const rawSvgs = import.meta.glob('@/assets/icons/mcp/*.svg', {
query: '?raw',
import: 'default',