Skip to content

fix(lint): ignore inactive mask declarations - #6186

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
AksharP5:mask-declarations
Oct 24, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
AksharP5:mask-declarations

Conversation

@AksharP5

Copy link
Copy Markdown
Contributor

What

Commented-out masks and CSS content strings no longer block project validation with a missing-texture error. Active masks still require their assets.

Same stylesheet input Main errors This PR errors
Commented mask, embedded or linked 1 0
Mask text in content, embedded or linked 1 0
Active missing mask, embedded, linked or inline 1 1

Why

Scanning raw CSS treats inactive text as a live declaration.

Related work

Fixes #6182. Preserves asset attribution and encoded-path behavior from #4616 and #1065.

How

Parse each stylesheet with the existing PostCSS dependency and inspect only mask-image / -webkit-mask-image declaration values. Retain URL cleaning, placeholder checks, path resolution and source attribution. If strict parsing fails, retain the existing raw mask scan so a valid missing-mask declaration beside malformed tokens cannot silently pass. Inactive text in malformed CSS retains the baseline behavior.

Test plan

  • Six focused regressions fail on main and pass with the fix. A seventh test reproduces and protects the malformed-inline-CSS case found in independent review.
  • Identical project fixtures run through the real lint API before and after, with active missing-mask controls.
  • Lint package: 1,015 tests pass. Existing CLI mask coverage: 7 tests pass.
  • Lint build/typecheck, lint, formatting and comment checks.
  • Rule documentation updated.
  • Comments follow CONTRIBUTING.md.

Independent GPT-6.1 Sol xhigh review: R1 found the malformed-inline-CSS safety regression described above; it is corrected. R2 found no blocker after 22 independent baseline/final scenarios and 13 focused tests..

Local full-workspace build is limited by missing preinstalled inspector/AWS dependencies. Mintlify validation is unavailable because mint is absent. No dependency installation was performed. CI results are tracked on this PR.

@mintlify

mintlify Bot commented Oct 24, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 675bca4.

Approve preview

@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.

Reviewed at 675bca4d. Approving. On main this rule runs a regex over the raw stylesheet text. A commented-out mask-image, or one inside a content string, counts as live and fails lint with a missing-texture error (#6182). Parsing with PostCSS and walking only mask-image / -webkit-mask-image declarations fixes that. postcss is already a dependency of the lint package, used the same way in rules/core.ts, rules/fonts.ts and rules/textures.ts. Inline style attributes parse as root-level declarations, which rules/core.ts already relies on.

The fallback is the right call. If PostCSS throws a CssSyntaxError, the rule goes back to the old raw scan, so a real missing mask next to broken CSS still errors, and the first new test pins that. As a bonus, matchAll over the declaration value catches every url() in a multi-layer mask, where the old pattern caught only one per declaration.

The new tests cover the comment and content cases in both embedded and linked stylesheets. The mixed test checks that both real misses are reported and both inactive ones aren't, and it would fail on main.

Need: yes, #6182 · Size: ok · Reuse: uses the existing postcss dependency and the parse pattern from rules/core.ts · Simpler: already minimal

— Rames

@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 24, 2026
Merged via the queue into heygen-com:main with commit 629dd8f Oct 24, 2026
68 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.

Inactive CSS mask declarations falsely block project lint

2 participants