hyperframes icon indicating copy to clipboard operation
hyperframes copied to clipboard

Lint: report data-duration values the parser rejects

Open jrusso1020 opened this issue 4 weeks ago • 1 comments

The parser already marks some data-duration values as invalid (for example "2s" or "-3") with an invalid-duration problem (packages/parsers/src/compositionContract.ts, around lines 268-270). The linter only turns deprecated-layer, deprecated-end and conflicting-end into findings (packages/lint/src/rules/composition.ts, around lines 1062-1081), so these values lint clean and the clip silently gets a different duration than the author wrote.

Scope

  • Report invalid-duration as a lint error with the element and the bad value.
  • Optional: do the same for invalid-track-index.

Files: packages/lint/src/rules/composition.ts, packages/lint/src/rules/composition.test.ts

Done when: hyperframes lint --json on a clip with data-duration="2s" reports an error (today it reports 0 findings), with a unit test for "2s" and "-3" and a passing case for a valid number.

Mentor: @jrusso1020. Comment here before you start so we can avoid duplicate PRs.

jrusso1020 avatar Nov 06 '26 00:11 jrusso1020

I'd like to work on this one — I'll report invalid-duration (and invalid-track-index) as lint errors in composition.ts with tests for "2s", "-3", and a valid number.

wanjinhao1 avatar Nov 06 '26 14:11 wanjinhao1