Skip to content

feat(lint): warn when composition is missing data-no-timeline#1338

Open
vanceingalls wants to merge 1 commit into
mainfrom
06-10-feat_lint_warn_when_composition_is_missing_data-no-timeline
Open

feat(lint): warn when composition is missing data-no-timeline#1338
vanceingalls wants to merge 1 commit into
mainfrom
06-10-feat_lint_warn_when_composition_is_missing_data-no-timeline

Conversation

@vanceingalls

@vanceingalls vanceingalls commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a missing_data_no_timeline lint rule to @hyperframes/core's composition linter.

Why

The producer polls window.__timelines[id] for up to 45 seconds waiting for a GSAP timeline to register before starting render. Compositions that never register a timeline (static compositions, pure-CSS animations, etc.) stall every render with a 45-second timeout before the producer gives up and proceeds. The fix is trivially cheap — data-no-timeline on the root element tells the producer to skip the poll entirely — but authors have no signal that they're paying this cost.

This rule surfaces the problem at lint time so it can be caught before render.

What changed

packages/core/src/lint/rules/composition.ts

  • New rule: missing_data_no_timeline
  • Fires as a warning when:
    • Composition has a data-composition-id root
    • No script in the composition calls window.__timelines[
    • Root element does NOT already have data-no-timeline
  • Provides a fixHint pointing to the exact attribute to add

packages/core/src/lint/rules/composition.test.ts

  • 38 new tests covering the new rule: fires when timeline missing, suppressed when data-no-timeline present, suppressed when window.__timelines registration found

Test plan

  • bun run test packages/core → all 1559 tests pass including 38 new rule tests

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vanceingalls vanceingalls force-pushed the 06-10-feat_lint_warn_when_composition_is_missing_data-no-timeline branch from 0c134a4 to 2bed9b4 Compare June 12, 2026 17:14
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.

1 participant