Add test coverage for styled-jsx jsx prop on <style> elements via module augmentation#3307
Draft
Add test coverage for styled-jsx jsx prop on <style> elements via module augmentation#3307
jsx prop on <style> elements via module augmentation#3307Conversation
Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/eb33e30e-abd1-402c-9440-873f0ca84270 Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix jsx prop on style tag not recognized
Add test coverage for styled-jsx Apr 1, 2026
jsx prop on <style> elements via module augmentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users reported
<style jsx>(styled-jsx pattern, common in Next.js) producingTS2322: Property 'jsx' does not exist on type 'DetailedHTMLProps<StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>'in typescript-go while the standard TypeScript extension showed no error.Investigation findings:
next-env.d.ts→/// <reference types="next" />→styled-jsx/global.d.ts, and the typescript-go extension may resolve the project in a different contextdeclare module 'react' { interface StyleHTMLAttributes<T> { jsx?: boolean } }) works correctly in typescript-go across all loading mechanisms:import,/// <reference types>,types[]in tsconfig, and transitive chainsChanges:
testdata/tests/cases/compiler/jsxStylePropStyledJsx.tsx— a regression test usingreact16.d.ts+declare module 'react'augmentation (the exact styled-jsx pattern) verifying that<style jsx>,<style global>, and<style jsx global>compile without error, while truly unknown attributes still correctly failsymbols,types) for the new test