Skip to content

fix(lint): detect timelines in local external scripts#2242

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/lint-local-external-timelines
Open

fix(lint): detect timelines in local external scripts#2242
miguel-heygen wants to merge 1 commit into
mainfrom
fix/lint-local-external-timelines

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

  • Load project-local <script src> files into the lint context.
  • Use local external script contents for timeline registry and timeline ID checks.
  • Add an end-to-end regression test for external timeline registration.

Why

Valid compositions that register window.__timelines in a local JavaScript file were incorrectly reported as missing_timeline_registry, forcing authors to duplicate the registration inline.

How

Project lint now resolves local script paths with the same project-root safety checks used for linked assets, ignores remote/data/blob scripts, and supplies the loaded source to timeline rules.

Test plan

  • bun run --filter @hyperframes/cli test -- --run src/utils/lintProject.test.ts
  • bun run --filter @hyperframes/lint test
  • bun run --filter @hyperframes/lint typecheck
  • bun run --filter @hyperframes/cli typecheck
  • bunx oxlint packages/lint/src/types.ts packages/lint/src/context.ts packages/lint/src/project.ts packages/lint/src/rules/core.ts packages/cli/src/utils/lintProject.test.ts

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