Repository navigation
fix(core): report a <style> block rendered as an expression child (TSRX3014) - #1130
Merged
Merged
Conversation
`{<style>…</style>}` in a children list is an expression, so the
analysis treated the block as an assigned one: it compiled to the
block's class-map object rendered as a child, and the siblings got no
scope hash (tsrx-org#83).
Report it as TSRX3014 when the block is the expression of a child
expression container, directly, in parentheses, or as a branch of a
conditional or logical expression. A block whose value is used, as an
attribute value or through a member read, is still an assigned block.
The code is in the error table and the specification, so the compiler,
the editor and tsrx-tsc report it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jonkwheeler
marked this pull request as ready for review
October 27, 2026 10:57
jonkwheeler
added a commit
that referenced
this pull request
Nov 14, 2026
…nd inline elements (#1337) * fix(website): build the site with a Ripple that keeps the spaces around inline elements #1105 restored the spaces between words and inline code or links in the website's sources, but the site still rendered most of them glued ("TSRX no longer has<code>&{ ... }</code>"): it builds with `@ripple-ts/vite-plugin` 0.4.0, which pins `@tsrx/ripple` 0.2.0, and that compiler drops a space at the edge of a multi-line text run. Ripple-TS/ripple #1608 fixed the trim in `@tsrx/ripple` 0.2.8. Move the Ripple packages the workspace builds with to the current release: `ripple`, `@ripple-ts/vite-plugin` and `@ripple-ts/adapter-node` 0.6.1, whose plugin uses `@tsrx/ripple` 0.2.11, and resolve the workspace's own `@tsrx/ripple` to 0.2.11 as well. The catalog range of `@tsrx/ripple` stays `^0.2.0`, so the optional peer range `@tsrx/typescript-plugin` publishes doesn't change. The release-age exclusions for the 0.4.0/0.2.0 releases go with them. Also put back the one space the sources still lacked, before `TSRX3014` in the specification (added by #1130 beside #1105). Fixes #481 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FRKmwAwuyPbGQ1ejNqiJ46
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.
Summary
A
<style>block rendered as an expression child now reports TSRX3014 in the compiler, the editor andtsrx-tsc:Before,
<>…{<style>.feature-card { … }</style>}</>compiled without a diagnostic to the block's class-map object rendered as a child, and the siblings got no scope hash.The rule covers a block that is the expression of a child expression container, directly, in parentheses, or as a branch of a conditional or logical expression (
{ready && <style>…</style>}). A block whose value is used, such as an attribute value (theme={<style>…</style>}) or a member read ((<style>…</style>).a), is still an assigned block, and a plain-TSX<style>{css}</style>element is untouched.The code is in the error table (
DIAGNOSTIC_CODES.STYLE_IN_EXPRESSION_CONTAINER,TSRX_ERRORS.STYLE_IN_EXPRESSION_CONTAINER), the specification (the 5.1 static constraints, the style-block constraint list and the error-code appendix), the content-mapper error examples, and the regenerated MCP docs index. The nested-<style>half of #83 was already fixed on main by sibling-scoped style blocks.Verification
packages/tsrx/tests/analyze/styles.test.js: four rejected shapes report TSRX3014 once at the block; attribute-value, member-read and conditional-member uses do not; a strict analysis throws it as fatal.packages/tsrx/tests/utils/error-codes.test.js: TSRX3014 is reported and listed in the specification.packages/content-mapper/tests/error-examples.test.js: the new example is reported once, with no TypeScript error on it, through classictsrx-tscand TypeScript 7.tsrx-tscreports it.npx vitest run --testTimeout=60000(the default 5s timeout trips under machine load): 176 of 176 test files passed (10016 tests, 82 skipped) at d0224ad.pnpm typecheckclean,pnpm changeset:checkpasses.Related
Fixes #83
🤖 Generated with Claude Code
Note
Low Risk
Additive static analysis in the style pass; it only rejects patterns that previously compiled incorrectly, with no runtime or data-path changes.
Overview
<style>inside JSX expression children is now a compile error (TSRX3014) instead of silently emitting the block’s class-map object as a child (so siblings never got a scope hash).The style analyzer adds
is_rendered_expression_child, which flags a block when it is the value of{…}under an element or fragment—including through parentheses,&&/||, and conditional branches. Assigned uses (props, member reads, etc.) are unchanged.TSRX3014 is wired through diagnostics, validation exports, specification/MCP docs, a content-mapper error example, and tests covering rejected shapes vs allowed value uses.
Reviewed by Cursor Bugbot for commit d0224ad. Bugbot is set up for automated code reviews on this repo. Configure here.