Skip to content

Release 1.0.2

Choose a tag to compare

@Tasete Tasete released this 14 Aug 04:14
· 3 commits to main since this release

v1.0.2

✅ Obsidian 审核合规修复

  • 修复 Error: no-static-styles-assignment

    • scrollContainer.style.overflow 直接赋值改用 classList.add/remove('sr-scroll-locked') CSS 类控制
  • 修复 Error: no-static-style-heading

    • 所有 createEl('h2'/'h3') 创建的 HTML 标题元素改用 new Setting(container).setName(...).setHeading()
  • 修复 Warning: prefer-create-el

    • 导出功能:document.createElement('a')document.body.createEl('a', { attr: {...} })
    • 导入功能:document.createElement('input')document.body.createEl('input', { attr: {...} }) as HTMLInputElement
  • 修复 Warning: 缺少声明式设置 API

    • 新增 getSettingDefinitions() 方法,返回 4 个 SettingDefinitionGroup(右键菜单、跟随栏、剔除刷、语言)
    • 新增 getControlValue() / setControlValue() 覆写方法,支持嵌套 useModes 键映射
    • 兼容 Obsidian 1.13.0+ 设置搜索功能
  • 修复 Warning: 不必要的类型断言

    • 移除 t() 模板字符串参数的冗余 as string 断言
  • 修复 Warning: Promise in void 上下文

    • 删除按钮的 async 事件处理器改为同步回调 + void this.plugin.saveSettings().then(() => doRefresh())
  • 修复 Warning: 不安全的 any 类型

    • catch(e: any)catch(e: unknown) + instanceof Error 类型守卫
    • JSON.parse() 结果标注 as unknown[],属性访问用 as Record<string, unknown>

✅ Obsidian Review Compliance Fixes

  • Fixed Error: no-static-styles-assignment

    • Replaced scrollContainer.style.overflow direct assignment with classList.add/remove('sr-scroll-locked') CSS class control
  • Fixed Error: no-static-style-heading

    • Replaced all createEl('h2'/'h3') HTML heading elements with new Setting(container).setName(...).setHeading()
  • Fixed Warning: prefer-create-el

    • Export: document.createElement('a')document.body.createEl('a', { attr: {...} })
    • Import: document.createElement('input')document.body.createEl('input', { attr: {...} }) as HTMLInputElement
  • Fixed Warning: missing declarative settings API

    • Added getSettingDefinitions() method returning 4 SettingDefinitionGroup items (context menu, following toolbar, eraser brush, language)
    • Added getControlValue() / setControlValue() overrides supporting nested useModes key mapping
    • Compatible with Obsidian 1.13.0+ settings search
  • Fixed Warning: unnecessary type assertion

    • Removed redundant as string assertion on t() template string arguments
  • Fixed Warning: Promise in void context

    • Converted async event handler to sync callback + void this.plugin.saveSettings().then(() => doRefresh())
  • Fixed Warning: unsafe any types

    • catch(e: any)catch(e: unknown) + instanceof Error type guard
    • Annotated JSON.parse() results as as unknown[], property access via as Record<string, unknown>

Full Changelog: v1.0.1...v1.0.2