Skip to content

fix(analyze): accept self-closing Match branches - #53

Open
lntutor wants to merge 3 commits into
askrjs:mainfrom
lntutor:fix/39-case-child-contract
Open

fix(analyze): accept self-closing Match branches#53
lntutor wants to merge 3 commits into
askrjs:mainfrom
lntutor:fix/39-case-child-contract

Conversation

@lntutor

@lntutor lntutor commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • recognize self-closing <Match when={...} /> elements as valid direct children of <Case>
  • retain diagnostics for non-Match children
  • add focused regression coverage

Context

The broader Case child validation from issue #39 was merged in #58 while this PR was open. That implementation accepted only JsxElement children, so valid self-closing Match branches were reported by askr/control-contract. This rebased PR now contains only the remaining compatibility fix.

Validation

  • focused analyzer suite: 15/15 tests
  • full npm run check: lint, typecheck, 202 tests with coverage, build, publint, and package dry-run

@lntutor
lntutor requested a review from smiggleworth as a code owner July 30, 2026 15:56
@lntutor
lntutor force-pushed the fix/39-case-child-contract branch from d58103a to 9d737f6 Compare July 31, 2026 01:22
@lntutor lntutor changed the title fix(analyze): validate Case children fix(analyze): accept self-closing Match branches Jul 31, 2026
@lntutor

lntutor commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main after #58 merged. This PR is now a focused fix for the remaining analyzer bug: valid self-closing <Match when={...} /> children were still diagnosed under <Case>. The full repository check passes (202 tests, lint, typecheck, coverage, build, publint, package dry-run).

@lntutor

lntutor commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged current upstream main into this branch without rewriting history. The conflict was additive in tests/analyze.rules.test.ts; the resolution preserves all upstream analyzer tests and retains the focused self-closing <Match /> regression test. Verified exact pushed head 4dc737c5a6aae815a6112ef9588cae283f325d18 with the focused regression test (1 passed) and full npm run check under Node 24.17.0 (lint, typecheck, 210 coverage tests, build, publint, and package dry-run all passed). GitHub now reports the PR mergeable; fresh CI is running.

@lntutor

lntutor commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Current head 4dc737c5a6aae815a6112ef9588cae283f325d18 now appears to be in a clean merge-ready state: the PR is mergeable, all visible CI jobs on that exact SHA have completed successfully, and there are no review threads or review-body comments open on the current PR state. The self-closing <Match /> regression remains isolated to the intended analyzer case, with the upstream main test additions preserved on this head. If this still matches the intended direction, it looks ready for maintainer review/merge when convenient.

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.

2 participants