From 22d05a98b3e53f0a950e243234565fd22e41683b Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 15 Jul 2026 18:12:04 +0800 Subject: [PATCH] =?UTF-8?q?chore(lint):=20=E4=BF=AE=E5=A4=8D=20Biome=20?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=EF=BC=88schema=20=E7=89=88=E6=9C=AC/optional?= =?UTF-8?q?=20chain/CSS=20!important=20=E6=8A=91=E5=88=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - biome.json: $schema 2.5.1 → 2.5.3,对齐已安装的 CLI 版本(消除 info) - code-block-view.ts:157: `a && a.b()` → `a?.b()`(等价 optional chain) - style.css:56: 保留刻意的 `transform: none !important`(删除会重新引入 animation-fill-mode: both 导致的堆叠上下文 bug),仅加 scoped biome-ignore 抑制 noImportantStyles,不做全局禁用 --- libs/biome.json | 2 +- libs/tiptap-editor/src/code-block-view.ts | 2 +- libs/yggdrasil-core/src/style.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/biome.json b/libs/biome.json index 5aae8c2..b0257bd 100644 --- a/libs/biome.json +++ b/libs/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.5.1/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.3/schema.json", "vcs": { "enabled": false }, diff --git a/libs/tiptap-editor/src/code-block-view.ts b/libs/tiptap-editor/src/code-block-view.ts index abfbc2d..60057ae 100644 --- a/libs/tiptap-editor/src/code-block-view.ts +++ b/libs/tiptap-editor/src/code-block-view.ts @@ -154,7 +154,7 @@ export class CodeBlockNodeView { if (mutation.target === this.contentDOM && mutation.type === 'attributes') return true; // contentDOM 内的 mutation(characterData/childList):交给 ProseMirror(编辑核心) // 注意 contains 对 target===contentDOM 自身也返回 true,故上面的 attributes 判断须在前。 - if (this.contentDOM && this.contentDOM.contains(mutation.target)) return false; + if (this.contentDOM?.contains(mutation.target)) return false; // 工具栏/结果区等装饰元素的 mutation:忽略 return true; } diff --git a/libs/yggdrasil-core/src/style.css b/libs/yggdrasil-core/src/style.css index 9117ea9..6557b92 100644 --- a/libs/yggdrasil-core/src/style.css +++ b/libs/yggdrasil-core/src/style.css @@ -53,5 +53,6 @@ html.is-theme-transitioning *::after { html.is-theme-transitioning .animate-page-enter { /* !important 必需:animation-fill-mode: both 保留的关键帧值优先级高于普通 规则,只有 !important 能覆盖,确保 VT 期间 transform 被清为 none。 */ + /* biome-ignore lint/complexity/noImportantStyles: animation-fill-mode: both 保留非 none transform 创建堆叠上下文,仅 !important 可覆盖(详见上方注释) */ transform: none !important; }