Skip to content

fix(lint): report data-duration values the parser rejects - #7286

Open
sx4im wants to merge 1 commit into
heygen-com:mainfrom
sx4im:fix-7272-invalid-duration-lint
Open

sx4im wants to merge 1 commit into
heygen-com:mainfrom
sx4im:fix-7272-invalid-duration-lint

Conversation

@sx4im

@sx4im sx4im commented Nov 6, 2026

Copy link
Copy Markdown

The parser already flags values like "2s" or "-3" as invalid-duration, but the linter only surfaced deprecated-layer, deprecated-end and conflicting-end, so these clips linted clean and silently got a different duration than written.

What changed: the composition lint rule now reports invalid-duration as an error with the element and the bad value, and does the same for invalid-track-index. Added unit tests for "2s", "-3", a non-integer track index, and a valid-number passing case. Documented both new codes in docs/reference/lint-rules.mdx.

How verified: new tests failed before the fix and pass after; full lint package suite 1277/1277 pass; typecheck, oxlint and oxfmt clean; CLI check on a clip with data-duration="2s" now reports 1 error (invalid_data_duration) and exits 1. Note: fork PR workflows need a maintainer to approve the run before CI starts.

Fixes #7272

@mintlify

mintlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 3106a75.

Approve preview

SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 6, 2026
Re-verified the nine merged PRs in heygen-com#7266-heygen-com#7288 against fork file:line and
reverse-apply checks; none needs a new port. The six open PRs (heygen-com#7266, heygen-com#7269,
heygen-com#7281, heygen-com#7282, heygen-com#7285, heygen-com#7286) are pinned as monitored with revisit conditions;
monitored 99 -> 105.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 6, 2026
…, record duplicate rule

Review PR heygen-com#7304-heygen-com#7335: 10 merged already adopted or deferred; 10 open or draft PRs
pinned (heygen-com#7304, heygen-com#7308, heygen-com#7311, heygen-com#7315, heygen-com#7321, heygen-com#7330-heygen-com#7334); open duplicates of
pinned heygen-com#7281/heygen-com#7285/heygen-com#7286/heygen-com#7296 are tracked by those pins. strict exit 0;
monitored 110 -> 120.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 7f372305b8675cbe335ab7f4e155b6ef4444033d.

Canonical parser diagnostics now produce duration/track-index errors with the affected value and element (packages/lint/src/rules/composition.ts:1105). The public codes are documented. I compared #7319/#7323; this submission has the strongest value/element/severity regression assertions and documents both codes.

Validation at this head: bun run --cwd packages/lint test src/rules/composition.test.ts → 317 passed. Focused tests ran after a full build on current main; built shared parser dependencies were reused. No full render replay or native Windows run locally. git merge-tree --write-tree origin/main 7f372305b8675cbe335ab7f4e155b6ef4444033d passed against main 539c70cee. No prior substantive reviews or inline comments were present.

Need: yes, requested starter issue · Size: ok · Reuse: existing lint/parser and manifest contracts · Simpler: already minimal · Structure: fine
Risk: low — bounded diagnostic or registry-lint change with focused coverage

— hf-review

Verdict: APPROVE
Reasoning: The requested behavior is implemented using the existing contracts, and the focused regression tests pass. No Important defect found.

The parser already flags values like "2s" or "-3" as invalid-duration,
but the linter only surfaced deprecated-layer, deprecated-end and
conflicting-end, so these clips linted clean and silently got a different
duration than the author wrote. Report invalid-duration as a lint error
with the element and the bad value, and do the same for
invalid-track-index.

Fixes heygen-com#7272
@sx4im
sx4im force-pushed the fix-7272-invalid-duration-lint branch from d7bfe3b to 3106a75 Compare November 7, 2026 01:12
@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks, @sx4im. This is approved, and the only thing holding it back is commit signing: main requires signed commits. The commit on this branch isn't verified.

To re-sign and push:

git rebase origin/main --exec "git commit --amend --no-edit -S"
git push --force-with-lease

GitHub's setup guide: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

If the content is unchanged, we'll queue it at your new head.

— Rames

This branch has not been deployed

No deployments
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.

Lint: report data-duration values the parser rejects

2 participants