Skip to content

lint: report parser-rejected data-duration and data-track-index values - #7319

Closed
wanjinhao1 wants to merge 1 commit into
heygen-com:mainfrom
wanjinhao1:agent/fix-7272-invalid-duration-lint
Closed

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

Conversation

@wanjinhao1

Copy link
Copy Markdown

What

The linter now reports invalid-duration and invalid-track-index timing diagnostics (already produced by the parser in compositionContract.ts) as findings, so values like data-duration="2s" or data-duration="-3" no longer lint clean.

Why

The parser marks some data-duration / data-track-index values as invalid, but the linter only turned deprecated-layer, deprecated-end and conflicting-end into findings, so a clip silently got a different duration/track than the author wrote.

Fixes #7272

Related work

Fixes #7272 (mentor @jrusso1020; claimed in the issue before starting, as requested).

How

Added a rule in packages/lint/src/rules/composition.ts that walks readTagTiming(tag.raw).diagnostics and maps invalid-duration → invalid_data_duration and invalid-track-index → invalid_data_track_index (both severity: "error"). Messages include the element (tag + id when present) and the rejected attribute/value; fixHint says what a valid value looks like. No parser changes.

Test plan

  • Unit tests added/updated — new tests in composition.test.ts: "2s" and "-3" report invalid_data_duration, a valid data-duration="2" reports nothing, and data-track-index="1.5" reports invalid_data_track_index (vitest run packages/lint/src/rules/composition.test.ts: all new tests pass)
  • Manual testing performed
  • Documentation updated (if applicable) — no docs changes needed; lint finding codes are not enumerated in docs
  • Comments follow CONTRIBUTING.md "Comments"

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks for contributing this fix. I reviewed the competing submissions and selected #7286, which includes the parser-based duration checks, element/value/severity regression cases, and documentation for both new lint codes. Closing this as a duplicate so the issue has one implementation to take through CI and merge: #7286. This is consolidation of overlapping work, not a rejection of your contribution.

@jrusso1020 jrusso1020 closed this Nov 7, 2026
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