Skip to content

Conversation

@cyfung1031
Copy link
Collaborator

@cyfung1031 cyfung1031 commented Feb 2, 2026

Fixes #1079


问题描述:
在某些情况下(例如 Service Worker 重启后),globalCache.get("eslint-fix") 返回 undefined,导致 Monaco Editor 中的 ESLint 自动修复功能无法正常工作,报错或无响应。

修复内容:

  • 移除对 globalCache 的依赖,避免缓存失效导致的问题。
  • 改为直接从当前 Monaco 编辑器实例 / 页面实际运行环境中获取 "eslint-fix" 相关配置或状态,确保值实时可用。
  • 修改位置主要在 Monaco Editor 初始化或 ESLint 插件加载逻辑中。

改动范围:

  • 只影响内置代码编辑器的 ESLint 修复功能,其他功能不受影响。
  • 经过本地测试,编辑脚本时 ESLint → Fix 按钮/快捷键恢复正常。

测试建议:

  1. 打开脚本编辑器
  2. 故意写一段有 ESLint 警告的代码
  3. 使用 ESLint 修复功能(按钮或快捷键)
  4. 验证是否能正确修复
  5. 可尝试 Service Worker 重启后重试

@cyfung1031 cyfung1031 changed the title [v1.3] 修复 #1079 [v1.3] 修复编辑器中 ESLint 修复功能失效的问题(globalCache.get("eslint-fix") 为 undefined)- 修复 #1079 Feb 2, 2026
@cyfung1031 cyfung1031 linked an issue Feb 2, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] globalCache.get("eslint-fix") 為 undefined

1 participant