lint: validate composition variables declared on supported root elements
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #4391 来自 @leorivastech —— 已关闭,未合并
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
- 领域
- testing-qa, tooling
调研方向
从 packages/lint/src/rules/composition.ts 中 issue 链接的 declaration rule 开始,然后阅读 packages/core/src/runtime/getVariables.ts 中的 getVariables,以确定受支持的声明元素。向 packages/lint/src/rules/composition.test.ts 添加回归用例,并运行列出的 Bun test、oxlint 和 oxfmt 命令。完成的标准是,格式错误的声明会在其源元素处报告一次,同时有效声明和 runtime 优先级保持不变。
由索引模型根据 Issue 内容生成。
描述
Invalid data-composition-variables JSON is diagnosed on <html> but passes lint on a composition-root div or template root. Runtime supports those declaring elements, so a typo there silently drops declared defaults without the existing helpful diagnostic.
Reproduction
From the repository root:
cat > /tmp/hf-d4.ts <<'TS'
const { lintHyperframeHtml } = await import(`${process.cwd()}/packages/lint/src/hyperframeLinter.ts`);
const root = `<div id="main" data-composition-id="main" data-no-timeline data-width="1920" data-height="1080" data-duration="10" DECLARATION></div>`;
for (const [name, html, options] of [
["html", `<html data-composition-variables='broken'><body>${root.replace("DECLARATION", "")}</body></html>`, {}],
["root", `<html><body>${root.replace("DECLARATION", "data-composition-variables='broken'")}</body></html>`, {}],
["template", `<template>${root.replace("DECLARATION", "data-composition-variables='broken'")}</template>`, { isSubComposition: true }],
] as const) {
console.log(name, (await lintHyperframeHtml(html, options)).findings.map((f: {code: string}) => f.code));
}
TS
bun /tmp/hf-d4.ts
Observed:
html [ "invalid_composition_variables_declaration" ]
root []
template []
Expected: all three malformed declarations receive invalid_composition_variables_declaration.
Scope and suggested approach
The existing declaration rule restricts validation to findHtmlTag(tags). getVariables collects declaring elements beyond <html>, and the existing binding diagnostic supports composition roots. Apply the existing declaration/schema validation to the supported declaring elements. Keep current schema and runtime behavior.
Add cases to composition.test.ts.
Acceptance criteria
- Malformed JSON and invalid declaration shapes are diagnosed on full-document roots and template/fragment composition roots.
- Valid supported declarations remain clean.
- Each invalid declaration is reported once with its actual source location/element where available.
- Multiple declaring elements are checked independently; validation does not change their runtime precedence.
- Existing composition-rule tests pass.
Estimated difficulty: easy. Reviewer/mentor: pending.
Related work
No active matching implementation was found in the checked inventory. Existing root-binding and source-location support should be reused; do not change variable precedence, schema, or the runtime's fallback behavior.
Validation
From a dependency-installed repository checkout, run the reproduction above with Bun. It imports source directly and does not need real media files, Chrome, or FFmpeg. Add regression cases in the linked existing suite, then run:
bun run --cwd packages/lint test src/rules/composition.test.ts
bunx oxlint packages/lint/src/rules/composition.ts packages/lint/src/rules/composition.test.ts
bunx oxfmt --check packages/lint/src/rules/composition.ts packages/lint/src/rules/composition.test.ts
Discovery ran the minimal source-level reproduction, not the full test suite or a video render. Reproduced on fa4261beea63bb4f36ff6a2f20fb4646fae3f2c6 (0.8.68); relevant source is unchanged on origin/main at 86fa10ced4297bfd9f4fe67b6767afae7a07fd3c (0.8.69).
Overlap refresh: checked open issue/PR titles and bodies from the fresh publication inventory on 2026-09-23; no matching active implementation found. Before starting, check the discussion and linked PRs, then comment with your intended approach so ownership can be coordinated.
- 主要语言
- TypeScript
- 星标
- 54.1k
- 派生
- 4.9k
- 平均合并
- 9 小时 46 分钟
- 30 天内合并 PR
- 652
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
heygen-com/hyperframes 的其他 Issue
-
Player: speed button's accessible name doesn't include its visible text可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
heygen-com/hyperframes#6021 ·
维护者通常 1 天内回复
-
inspector: build.mjs resolves paths with URL#pathname, fails ENOENT (F:\\F:\\...) and aborts bun run build on Windows可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
heygen-com/hyperframes#5863 · 1 条评论 ·
维护者通常 1 天内回复
-
product-launch-video: assemble-index.mjs is not idempotent — a second run drops every approved frame video可能已有人在做 @Dante-dan 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
heygen-com/hyperframes#5733 ·
维护者通常 1 天内回复
-
gsap_tween_tail counts GSAP's force3D and autoRound flags as properties可能已有人在做 @rudycelekli 于 5 天前认领。 未关闭bug triage/needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
heygen-com/hyperframes#5683 ·
维护者通常 1 天内回复
-
Timeline: show a clip's full name when its label is cut off可能已有人在做 @DanielMcSheehy 于 3 天前认领。 未关闭desktop-candidate difficulty/easy enhancement good first issue help wanted triage/ready
难度 2/5 1-3 小时 新手友好度 85/100
heygen-com/hyperframes#5582 · 2 条评论 ·
维护者通常 1 天内回复
查看 heygen-com/hyperframes 的全部 Issue
相似的 Issue
-
bug P3 UI/UX
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
StellarState/SS-backend#712 ·
维护者通常 1 天内回复
-
area: backend bug
难度 2/5 1-3 小时 新手友好度 78/100
snapotter-hq/SnapOtter#3473 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
gitroomhq/postiz-app#2304 ·
维护者通常 1 天内回复
-
harlan-agent-ready-to-implement routine:ci-review
难度 2/5 1-3 小时 新手友好度 72/100
harlan-zw/unlighthouse#454 · 2 条评论 ·
维护者通常 1 天内回复