feat(lint): detect missing adapter library scripts (GSAP, Lottie, Three.js)#149
Closed
miguel-heygen wants to merge 1 commit intomainfrom
Closed
feat(lint): detect missing adapter library scripts (GSAP, Lottie, Three.js)#149miguel-heygen wants to merge 1 commit intomainfrom
miguel-heygen wants to merge 1 commit intomainfrom
Conversation
…ee.js) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8bee1c6 to
f8cb0e6
Compare
jrusso1020
approved these changes
Mar 31, 2026
3 tasks
miguel-heygen
added a commit
that referenced
this pull request
Mar 31, 2026
…ith plugin system (#170) ## Summary - Breaks `hyperframeLinter.ts` from 1,314 lines (one massive function) into a plugin system of focused rule modules - Introduces `LintContext` — HTML is parsed once and shared across all rules - Adds `LintRule<TContext>` type as the formal contract for rules - Public API unchanged: `lintHyperframeHtml`, `lintMediaUrls`, `lintScriptUrls` signatures identical ## New file structure ``` src/lint/ utils.ts — shared types (OpenTag, ExtractedBlock), regex constants, helpers context.ts — LintContext type + buildLintContext() factory rules/ core.ts — structural rules (root attrs, timeline registry, script syntax) media.ts — media element rules (duplicate ids, video pitfalls, placeholder URLs, etc.) gsap.ts — GSAP rules + GSAP-specific parsing utils captions.ts — caption rules composition.ts — timed element, deprecated attrs, template literal selector, external scripts adapters.ts — Lottie + Three.js missing-script rules (from PR #149) hyperframeLinter.ts — orchestrator only (~200 lines, down from 1,314) ``` ## Adding a new adapter rule going forward 1. Create `src/lint/rules/my-adapter.ts` exporting `myAdapterRules: LintRule[]` 2. Import and spread into `ALL_RULES` in `hyperframeLinter.ts` ## Test plan - [x] All 402 core tests pass unchanged - [x] Full workspace build clean (`pnpm build`) - [x] TypeScript strict mode clean (`pnpm tsc --noEmit`)
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.
Summary
missing_gsap_script— usesgsap.to/from/timelineorwindow.__timelinesbut no GSAP<script>tagmissing_lottie_script— hasdata-lottie-srcorlottie.loadAnimationbut no Lottie<script>tagmissing_three_script— referencesTHREE.but no Three.js<script>tagfixHintwith the recommended CDN script tagStacks on
fix/lint-improvements(#134).Test plan