Repository navigation
fix(lint): report invalid data-duration and data-track-index values as errors - #7323
Closed
wanjinhao1 wants to merge 1 commit into
Closed
wanjinhao1 wants to merge 1 commit into
wanjinhao1 wants to merge 1 commit into
Conversation
…x values as lint errors
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two lint rules to
packages/lint/src/rules/composition.tsthat surface the parser'sinvalid-durationandinvalid-track-indexdiagnostics as lint errors (invalid_data_duration,invalid_track_index), with the element and the bad attribute value in the message.Why
The parser already marks values like
data-duration="2s"or"-3"asinvalid-duration(compositionContract.ts ~L268), but the linter only turneddeprecated-layer/deprecated-end/conflicting-endinto findings, so these values linted clean and the clip silently got a different duration than the author wrote.Fixes #7272
Related work
Refs #7272 (mentor @jrusso1020). Separate from #7291 (different rule, different issue).
How
New rule block iterating
tags, reading each tag's timing viareadTagTiming, and mappinginvalid-duration/invalid-track-indexdiagnostics to error findings following the existingdeprecated_data_layer/deprecated_data_endpattern (elementId, fixHint, snippet). No parser changes.Test plan
composition.test.ts— invalid"2s"and"-3"durations report twoinvalid_data_durationerrors; a valid3.5duration reports none; a1.5track index reportsinvalid_track_index.npx vitest run packages/lint/src/rules/composition.test.ts -t "invalid timing"→ 3 passed.invalid_composition_variables_declarationfailures and the lefthook typecheck failure (missing generatedruntime-inline,bununavailable locally) reproduce on a clean checkout oforigin/mainand are unrelated to this change.This PR was prepared with AI assistance and reviewed by the contributor.