This lands the clue collection line on top of origin/dev (v0.32.1, DSH 0.2.2-rc.2). The 14 commits that carried it are squashed into this one because every one of them overlapped upstream's own changes (version, 19 dictionaries, CHANGELOG), and each intermediate commit would have failed to compile against rc.2's menu API. The pre-integration head is kept at backup/clues-uiux-refresh-pre-rebase. What the feature is: - a Clues tab that reads local files, Feishu tasks/docs and GitHub issues/pulls through one source registry, with a scope row, shared search, filters, paging and stable [[dsh-clue:...]] references; - one window host for detail, pack management, source configuration, new pack and sharing (preview and edit are separate paths: a read is never saved over); - .cluepack export/import with per-row resolvability previews; - a source runtime that owns dependency installs and connection authorization (gh, lark-cli device code) and only probes on an explicit read; - the public betterSidebarClues service and the windows capability (features gains clues / windowHost). Merged with upstream rather than over it: - the settings section keeps upstream's start-page takeover group and this branch's clue sources group; navigation is now six groups; - the dictionaries keep both sides' new keys (1211 each, verified equal across all 19), the external-plugin guide and CHANGELOG keep both histories, and service features list both capability sets. Adapted to 0.2.2-rc.2: - menu call sites use anchorPoint instead of getAnchorRect; - the shared SelectMenu mounts the host menu only while open, because rc.2's Menu reads the DOM during render and broke server-rendered settings surfaces; - the submenu flip workaround stays deleted (the host positions submenus now), pinned by an updated layout-css assertion. Version 0.33.0 (three synced spots) with a new 未发布 / Unreleased changelog section; package.json regains the ./clues export, lib/clues.js and the uqr dependency that upstream never had. Gates: typecheck, lint, 5410 unit tests, build, check:consumer-types and the full mount lane (35 passed) against dsh 0.2.2-rc.2 in Chromium.
96 lines
3.6 KiB
JavaScript
96 lines
3.6 KiB
JavaScript
// ESLint flat config(最小规则集):
|
||
// - 基础:@eslint/js recommended + typescript-eslint recommended(非 type-checked 档,
|
||
// 全量 type-checked 需要项目服务且更慢,当前收益不足以引入);
|
||
// - react-hooks recommended:client 侧是 React 重镇,依赖数组豁免注释
|
||
// (react-hooks/exhaustive-deps)由此规则消费;
|
||
// - globals 按运行域分治:client bundle → browser,host/脚本 → node,tests → 混合。
|
||
import js from '@eslint/js'
|
||
import globals from 'globals'
|
||
import reactHooks from 'eslint-plugin-react-hooks'
|
||
import tseslint from 'typescript-eslint'
|
||
|
||
export default tseslint.config(
|
||
// 构建产物 / 工具目录不参与 lint(node_modules 默认不进,但**点开头目录
|
||
// 并不自动排除**——`.worktrees/`、`.delta/`、`.agents/worktrees/` 都必须
|
||
// 显式列出,否则 ESLint 会走进那些陈旧检出,把别的分支的错误报成我们的:
|
||
// 实测一次 1115 errors)。`.agents/skills/` 仍要 lint,不能整个忽略 `.agents/`。
|
||
{
|
||
ignores: [
|
||
'lib/',
|
||
'dist/',
|
||
'coverage/',
|
||
'registry/',
|
||
'playwright-report/',
|
||
'test-results/',
|
||
'node_modules/',
|
||
'.worktrees/',
|
||
'.delta/',
|
||
'.agents/worktrees/',
|
||
// Local validation output can contain frozen source/test baselines.
|
||
'.local/',
|
||
],
|
||
},
|
||
|
||
js.configs.recommended,
|
||
tseslint.configs.recommended,
|
||
reactHooks.configs.flat.recommended,
|
||
|
||
// react-hooks v7 的 recommended 捆绑了 React Compiler 语义规则(purity /
|
||
// immutability / refs / set-state-in-effect 等):本仓库对 CodeMirror / xterm
|
||
// 等命令式集成大量依赖 render 期读 ref、effect 内同步 setState 的既有模式,
|
||
// 57 处存量报错均为噪音级误报,先整体关闭该档,只保留经典双规则
|
||
// (rules-of-hooks / exhaustive-deps——后者消费代码里带理由的豁免注释)。
|
||
{
|
||
rules: Object.fromEntries(
|
||
[
|
||
'config',
|
||
'error-boundaries',
|
||
'gating',
|
||
'globals',
|
||
'immutability',
|
||
'incompatible-library',
|
||
'preserve-manual-memoization',
|
||
'purity',
|
||
'refs',
|
||
'set-state-in-effect',
|
||
'static-components',
|
||
'unsupported-syntax',
|
||
'use-memo',
|
||
].map(rule => [`react-hooks/${rule}`, 'off']),
|
||
),
|
||
},
|
||
|
||
// 孤儿 eslint-disable 注释(规则未实际触发)直接报错,防止豁免残留。
|
||
{ linterOptions: { reportUnusedDisableDirectives: 'error' } },
|
||
|
||
// no-unused-vars 对齐仓库既有约定:下划线前缀 = 刻意不用的占位(mock 桩等)。
|
||
{
|
||
rules: {
|
||
'@typescript-eslint/no-unused-vars': ['error', {
|
||
argsIgnorePattern: '^_',
|
||
varsIgnorePattern: '^_',
|
||
caughtErrorsIgnorePattern: '^_',
|
||
}],
|
||
},
|
||
},
|
||
|
||
// client bundle 运行在浏览器(portal 侧边栏 / 各视图 / 拦截层)。
|
||
{
|
||
files: ['src/client/**/*.{js,mjs,cjs,ts,tsx,jsx}'],
|
||
languageOptions: { globals: globals.browser },
|
||
},
|
||
|
||
// host 侧插件入口、构建/运维脚本与 skill 自带脚本都跑在 Node。eslint.config.js 自身不 ignore:
|
||
// 它就是一个普通 ESM 脚本,走 js recommended + node globals 正常通过。
|
||
{
|
||
files: ['src/*.{js,mjs,cjs,ts}', 'scripts/**/*.{js,mjs,cjs,ts}', '.agents/skills/**/*.{js,mjs,cjs,ts}', '*.config.ts', 'eslint.config.js'],
|
||
languageOptions: { globals: globals.node },
|
||
},
|
||
|
||
// tests:Node 里跑(vitest / fs fixtures),jsdom 组件测试又摸浏览器全局。
|
||
{
|
||
files: ['tests/**/*.{js,mjs,cjs,ts,tsx,jsx}'],
|
||
languageOptions: { globals: { ...globals.node, ...globals.browser } },
|
||
},
|
||
)
|