Repository navigation
Use TSX grammar for JSX syntax precheck - #9
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac8cfceabb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "typescript" => [".ts", ".mts", ".cts"] | ||
| .iter() | ||
| .any(|suffix| path.ends_with(suffix)), | ||
| "tsx" => path.ends_with(".tsx"), |
There was a problem hiding this comment.
Add TSX to the candidate report schema
When a TSX syntax_precheck_candidate report is produced, this reader now explicitly accepts the tsx language and the added test treats that as valid, but schemas/syntax-precheck-candidate.schema.json still restricts both backend.language and backend.dialect to java or typescript (lines 25–26). Consequently, every TSX candidate report accepted by the Rust contract is rejected by consumers validating against the published schema; extend those schema enums to include tsx.
Useful? React with 👍 / 👎.
| .unwrap_or("source.ts"); | ||
| let mut report = json!({ | ||
| "schema_version": "0.3.0", | ||
| "schema_version": if language == "tsx" { "0.4.0" } else { "0.3.0" }, |
There was a problem hiding this comment.
Document the separate TSX feedback version
For a .tsx request without native context, this branch now emits eslint_local_feedback 0.4.0, but the public command documentation still says that lint typescript <file> returns TypeScript feedback 0.3.0 (README.md:184, docs/Codeguard-Command-Reference.md:13, and its Chinese counterpart). A consumer following those documented contracts will select eslint-local-feedback-v0.3.schema.json, whose version and language constants reject this output; update the command-facing documentation to distinguish .tsx 0.4.0 from .ts/.mts/.cts 0.3.0.
Useful? React with 👍 / 👎.
| "minItems": 3, | ||
| "maxItems": 3, |
There was a problem hiding this comment.
Version the expanded grammar manifest contract
This changes the grammar-asset-manifest:1.0.0 contract from exactly two assets to exactly three while leaving both the schema ID and schema_version at 1.0.0. The previous parse_grammar_asset_manifest implementation also required that same version with exactly two assets, so an older consumer presented with the new same-version manifest rejects it rather than recognizing a new contract; publish the expanded shape under a new version (and retain the old schema if historical manifests remain supported).
Useful? React with 👍 / 👎.
lint typescriptaccepted.tsxfiles but passed them to the plain TypeScript grammar, so valid JSX could appear as a suspected syntax issue. The opt-in WASM precheck now uses the pinned TSX grammar for.tsx, reports its separate 0.4.0 schema and grammar identity, and keeps the existing TypeScript 0.3.0 path for.ts/.mts/.cts. Candidate reports also reject a source path whose extension disagrees with the claimed grammar dialect.The TSX bytes come from the same fixed CodeGraph commit as the existing candidates; their SHA-256, upstream version, shared MIT license and ABI are pinned. This remains a local, unqualified candidate: native ESLint still has priority, zero recoveries still mean incomplete, and no release or delivery approval is claimed.
Validation: valid and invalid JSX fixtures, forged dialect rejection, pinned asset tests, Rust offline WASM load, feature-gated CLI regression, grammar status contract, Clippy with warnings denied, layering, OpenSpec strict validation, and format/diff checks passed locally. Full workspace CI is pending.