Skip to content

fix(lint): parse inline script type and source attributes - #5220

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/lint-inline-script-attribute-semantics
Oct 8, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/lint-inline-script-attribute-semantics

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

The inline-script syntax rule currently reads type and src with regexes. Valid unquoted or mixed-case module/importmap/JSON types receive classic-JavaScript syntax errors, while data-src, data-type, or quoted metadata mentioning those attributes can suppress a real error.

Read the actual decoded attributes with the existing HTML parser and normalize the type before applying the same four exemptions. Classic scripts with metadata are checked; true external scripts and exempt types keep their existing treatment, including first-attribute semantics.

Validation:

  • 15 fail-first cases; 18 total regression/control cases cover unquoted/mixed-case/encoded types, duplicate attributes, metadata, and real external attributes.
  • Full lint suite: 852 passed. CLI lint/check suites: 149 passed. Lint findings remain identical for all 214 shipped compositions.
  • Built CLI verifies four formerly rejected valid fixtures, three formerly missed syntax errors, and the unchanged classic control.
  • Native Chromium executes the unquoted module and reads the JSON data block without errors. The module composition passes strict check, runtime/layout, and all five contrast samples.
  • Parser/lint/CLI builds, lint typecheck, repository lint/format, pre-commit gates, comment checks, deletion guard, and test reachability pass.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that on main \bsrc\s*= matches data-src=, and that an unquoted type=module gets a false syntax error. Reading the real attributes through the existing decoded reader fixes both and matches how the gsap rule already detects module scripts. The tests cover the regressions and the controls, and they fail on main.

— Rames

@jrusso1020
jrusso1020 enabled auto-merge October 8, 2026 20:01
@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 8, 2026
Merged via the queue into heygen-com:main with commit 9111d9f Oct 8, 2026
78 checks passed
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.

2 participants