Repository navigation
fix(lint): ignore inactive mask declarations - #6186
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
jrusso1020
left a comment
There was a problem hiding this comment.
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
What
Commented-out masks and CSS
contentstrings no longer block project validation with a missing-texture error. Active masks still require their assets.content, embedded or linkedWhy
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-imagedeclaration 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
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
mintis absent. No dependency installation was performed. CI results are tracked on this PR.