Repository navigation
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
miguel-heygen
left a comment
There was a problem hiding this comment.
Thanks, this is a tidy fix. Putting the three GLSL types in one shared set means the shader rule and the syntax rule can't disagree again, and I like that the new test asserts the whole findings list is empty, so no other rule trips on shader source either. I confirmed the new assertions fail on the old core.ts and pass with the change, and that the cosine/pow warning still fires.
One optional follow-up, not needed for this PR: the syntax check still works from a list of types to skip, so other inert data blocks get the same false error. application/ld+json with valid JSON, text/plain and text/x-template all report invalid_inline_script_syntax on this branch. Browsers only run JavaScript types, module and importmap, so checking only those (packages/lint/src/rules/core.ts:808) would cover every data block at once.
Verdict: APPROVE
Reasoning: The fix is correct and minimal, the tests go through the public lint entry and fail without the change, and all checks are green.
What
Valid inline GLSL shaders fail lint with
invalid_inline_script_syntax, because the JavaScript syntax rule tries to parse their source as JavaScript. The three shader types already supported by the shader rule now pass that check.Same input on upstream main and this branch:
This block is in the complete composition and Node reproduction in #6225.
3d45d1b037860afd42439a2b4ca7e0dc762448c3okfalsetrueerrorCount10invalid_inline_script_syntax,Unexpected token (2:10), line 5, column 11[]The same false error is fixed for
x-shader/x-vertexandtext/glsl. Unsafe shader expressions still emitshader_unbounded_cosine_pow.Why
Authors cannot pass the static lint gate with GLSL data blocks that the linter explicitly supports. The existing shader regression checked only its warning, hiding the concurrent syntax error.
Related work
Closes #6225.
#5640 added GLSL shader warnings, which this fix preserves. #929 and #928 cover the already-fixed module/importmap case. #2223 handles embedded HTML structure. Open and closed issues/PRs were searched by symptom and shader MIME types on 2026-10-24, most recently at 16:32 UTC; no competing report or implementation was found. #779 is an unrelated closed registry contribution.
How
Keep the supported GLSL MIME types in one shared set. Both shader detection and the existing JavaScript syntax exemptions use it. No new rule or public API.
Test plan
docs/packages/lint.mdx.Workspace build passed. After rebasing over an engine-only upstream commit, repeated lint build, lint typecheck and the full lint suite. Oxlint, oxfmt, Fallow, comment citations and comment share checks passed.
Environment: Linux x64, Node 26.11.1, installed Bun 1.4.1 versus the repository's 1.4.4 pin.
/tmprejected writes with error-122; validation passed withTMPDIRpointing inside this checkout's ignored dependency directory. No software upgrade or system configuration change. Mintlify is not installed, so its docs validation was not run.