Repository navigation
fix(lint): a timeline registered in a local script file counts as registered - #6829
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head ec36ea1a
A timeline in a <script type="module" src> file still fails check. The missing_timeline_registry error is replaced by a false invalid_inline_script_syntax error. ↓ inline
Scope
Read the whole diff and every rule that reads ctx.scripts and checks attrs/raw. Ran the lint package locally (1233/1233). I probed master and this head with three fixtures: a classic animation.js (fixed), an inline module with import (clean on both), and a type="module" src file with import (master: missing_timeline_registry; this head: invalid_inline_script_syntax at main.js:1). The fails without the fix: line is present and checks out. CI was still running at review time.
Edit accuracy: accurate 271 (base branch 271), smooth 102 of thoseThe gate passes. Quarantined, measured but not gated (0) |
ec36ea1 to
b1889ad
Compare
…view Adopts heygen-com#7250 (SVG stroke drawing is not a dead stretch), heygen-com#7248 (contract check reads a timeline registered in a local script), heygen-com#7252 (comma-list selectors hidden by authored CSS), heygen-com#7238 (snapshot and preview show a clip on the render frame), heygen-com#7237 (stalled cloud upload retries) and heygen-com#7251 (per-scene SVG id namespacing), with prerequisite heygen-com#6829. Defers heygen-com#7246 (needs the delivery limiter from heygen-com#6940) and heygen-com#7232 (needs the WebKit decode-first pipeline), with conditions in the ledger. Watermark advances to b108f85. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
hyperframes checkandlintnow read a project's local<script src>files. A timeline registered inanimation.js(or any local script file) no longer getsmissing_timeline_registry("Missingwindow.__timelinesregistration"), and the script rules see that file's code as they would an inline<script>.Why
A feedback report said the author "had to inline the root timeline because external
animation.jswas not discovered by static lint". The same registration passed inline and failed from a file: lint read only inline<script>text, so the error fired for a project that renders fine.Related work
missing_data_no_timelinealready stops when any<script src>is present, because it cannot see files; this reads the files instead, the way linked stylesheets are already read (externalStyles).How
lintProjectfinds local<script src>files in the root and each sub-composition, resolved beside the file or from the project root like stylesheets, and passes them asexternalScripts. They join the lint context'sscripts(so the script rules analyse them) andmissing_timeline_registryalso checks their text. Remote URLs,data:andblob:sources, minified files (*.min.js) and files over 1 MB are not read, so a vendored library is not linted as authored code.Size
88 changed lines (84 added, 4 removed) in 5 files.
Test plan
project.test.ts: a root whoseanimation.jsregisters the timeline gets nomissing_timeline_registry, and one whoseanimation.jsregisters nothing still gets itlintProjectandlintsuites 81/81, three runs in a rowfails without the fix:
project.test.ts > local script files > counts a timeline registered in a local script filefails without the fix (module files):
project.test.ts > local script files > reads a module script file as a modulefails when the syntax rule reads the tag fromscript.rawagain (atype="module"file starting withimportgets a falseinvalid_inline_script_syntax).What I measured
Built CLI on Linux,
lint --json: a root with<script src="animation.js">registering the timeline reportedmissing_timeline_registrybefore this change, and the same code inline reported nothing. The built CLI after the change was not run; the lint package and CLI lint suites above cover it.What I did NOT execute
The reporter's project, Studio's per-file lint (it does not go through
lintProject), and rules that now analyse a local script file for the first time on a large authored script.