mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-15 11:58:34 +08:00
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:
parent
f97624874c
commit
6aad9fd945
@ -162,7 +162,6 @@ function onEditorMount(editor: monaco.editor.IStandaloneCodeEditor) {
|
|||||||
// is needed because monaco's d.ts marks the static `languages.json`
|
// is needed because monaco's d.ts marks the static `languages.json`
|
||||||
// namespace as deprecated even though it's still the official runtime
|
// namespace as deprecated even though it's still the official runtime
|
||||||
// API for jsonDefaults.setDiagnosticsOptions in the v0.55.x line.
|
// 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
|
const jsonLang = (monaco.languages as any).json
|
||||||
if (jsonLang?.jsonDefaults) {
|
if (jsonLang?.jsonDefaults) {
|
||||||
jsonLang.jsonDefaults.setDiagnosticsOptions({
|
jsonLang.jsonDefaults.setDiagnosticsOptions({
|
||||||
|
|||||||
@ -132,7 +132,7 @@ export function useMessages(options: UseMessagesOptions = {}): UseMessagesReturn
|
|||||||
if (!message) return
|
if (!message) return
|
||||||
|
|
||||||
// 获取或创建对应类型的 contentPart
|
// 获取或创建对应类型的 contentPart
|
||||||
let contentParts = [...(message.contentParts || [])]
|
const contentParts = [...(message.contentParts || [])]
|
||||||
const partIndex = contentParts.findLastIndex(p => p.type === type)
|
const partIndex = contentParts.findLastIndex(p => p.type === type)
|
||||||
|
|
||||||
if (partIndex === -1) {
|
if (partIndex === -1) {
|
||||||
|
|||||||
@ -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
|
* 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.
|
* 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]/
|
const DANGEROUS_CHAR_RE = /[<>"'`\n\r\x00-\x1F\x7F]/
|
||||||
|
|
||||||
/** Slug length cap. Backend `toSlug` produces slugs well under this. */
|
/** Slug length cap. Backend `toSlug` produces slugs well under this. */
|
||||||
|
|||||||
@ -887,6 +887,7 @@ const modelPromptText = computed<{ title: string; desc: string }>(() => {
|
|||||||
case 'unprobed':
|
case 'unprobed':
|
||||||
return { title: t('chat.prompt.unprobed.title'), desc: t('chat.prompt.unprobed.desc') }
|
return { title: t('chat.prompt.unprobed.title'), desc: t('chat.prompt.unprobed.desc') }
|
||||||
case 'no-models':
|
case 'no-models':
|
||||||
|
default:
|
||||||
return {
|
return {
|
||||||
title: t('chat.prompt.noModels.title', { name: p?.name || '' }),
|
title: t('chat.prompt.noModels.title', { name: p?.name || '' }),
|
||||||
desc: t('chat.prompt.noModels.desc'),
|
desc: t('chat.prompt.noModels.desc'),
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="stage-labels">
|
<div class="stage-labels">
|
||||||
<div
|
<div
|
||||||
v-for="(stage, idx) in stages"
|
v-for="stage in stages"
|
||||||
:key="stage.key"
|
:key="stage.key"
|
||||||
class="stage-label-cell"
|
class="stage-label-cell"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
* The catalog entry's `iconKey` must match the basename.
|
* 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', {
|
const rawSvgs = import.meta.glob('@/assets/icons/mcp/*.svg', {
|
||||||
query: '?raw',
|
query: '?raw',
|
||||||
import: 'default',
|
import: 'default',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user