Repository navigation
feat(typescript): add biome and tsc composite actions - #12
Conversation
Add the TypeScript overlay's execution lane to the platform, mirroring the ruff + pyright (Python) split: Biome owns lint + format + import-sorting, tsc owns type correctness, so the two never double-report. - actions/biome: `biome ci --error-on-warnings --reporter=github` via npx, pinned to Biome 2.5.1. No CLI exclude (Biome has none) — scope via paths or the config's files.includes. - actions/tsc: `tsc --noEmit --project <p>` via npx --package [email protected]. --noEmit lives on the CLI so the shared base stays usable for builds. - Vendor modules/typescript/{biome.json,tsconfig.json} (strict, ruleset-only; biome.json is root:false so it loads from a nested path) + a good fixture, and dogfood both actions in ci.yml behind the ci-status gateway. - .editorconfig: add a JS/TS 2-space section aligned with Biome's formatter. Versions verified against the live registries (Biome 2.5.1, TypeScript 6.0.3); configs re-derived from the official Biome and TypeScript docs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 901cc82349
ℹ️ 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".
| "noPropertyAccessFromIndexSignature": true, | ||
| "noImplicitReturns": true, | ||
| "isolatedModules": true, | ||
| "verbatimModuleSyntax": true, |
There was a problem hiding this comment.
Avoid forcing ESM-only syntax in the base config
When a consumer tsconfig extends this base and sets compilerOptions.module to commonjs, tsc --noEmit reports TS1287 on ordinary export declarations; TypeScript documents that under verbatimModuleSyntax, ECMAScript imports/exports are not rewritten when settings imply another module system and error instead (https://www.typescriptlang.org/tsconfig/verbatimModuleSyntax.html). Because this base intentionally leaves module to consumers, this option makes the shared tsc action unusable for CommonJS TypeScript projects unless they rewrite to export =/import = require, so it should be left to consumer configs or paired with an explicit ESM-only contract.
Useful? React with 👍 / 👎.
Lowercase the issue-ref-pattern with the same awk tolower that lowercases the body, so mawk and gawk stay consistent on non-ASCII ids, and fold only [:upper:] (the [:lower:] mapping was a no-op on the lowercased body). Add a regression case that a default caller's "Closes #12-followup" still passes, which pins the custom-only hyphen boundary. Co-Authored-By: Claude Opus 5.5 <[email protected]>
) Closes #731 ## Summary Adds an optional `issue-ref-pattern` input to `.github/actions/pr-require-checks/check-contract` so a repository whose work items live outside GitHub Issues can pass the linkage check with its own ids (`Closes ENG-123`, `Refs: SW2-1`). The default is today's GitHub grammar exactly, so callers that set nothing are unchanged. ## Fix - `action.yml`: new input `issue-ref-pattern`, default `([a-z0-9_.-]+/[a-z0-9_.-]+)?#[0-9]+` (the regex the analyzer hardcoded), passed to `run.sh` through `env:` only, never inlined in `run:`. - `run.sh`: the closing-keyword and `Refs:`/`Relates to:` regexes are built from the pattern, which awk reads through `ENVIRON` (no escape processing, never program text). An empty input means the default. - Validation before any API call: single line; compiles both bare and as the parenthesized group it is spliced into (so an unbalanced `)` cannot escape the group); must not match the empty string (else a bare "Closes" would count). - Mechanism choices worth a look: the pattern **replaces** the GitHub grammar rather than adding to it, and it is matched case-insensitively (body and pattern are lowercased, as the existing analyzer already lowercases the body). The negation check and the `No related issue:` opt-out apply unchanged. - With a custom pattern the keyword needs whitespace or a colon before the id (`Closes ENG-1`, `Fixes: ENG-1`), so `fixture-1` cannot read as `fix` + `ture-1`; the default keeps its original optional separator (`fix#1` unchanged). Found by the fresh-context code review. - From the CI review round: `[:upper:]` folds to `[:alpha:]` (the body and pattern are both lowercased by the same awk `tolower`); a pattern anchored with `^` or a trailing `$` is rejected; with a custom pattern a closer followed by `-` (`ENG-123-extra`) is not a match. Each has a test, and the default `#N` boundary is pinned by a regression case. - Known limits, documented in the README rather than coded around: with a custom pattern a negated `#N` is no longer flagged (the pattern replaces `#N`); a caller-chosen pattern with nested quantifiers can backtrack slowly under mawk against an attacker-written body (it only reddens that PR's own check). A pre-existing quadratic cost in `negation_trigger` on a long unpunctuated line of closers (same before and after this PR) is out of scope. - Messages: with the default they are byte-identical to before (`Closes/Fixes/Resolves #N`); with a custom pattern they say `<ref>` and name the pattern. - No reusable workflow wraps this composite (`pr-require-checks.yml` is this repo's own CI, not `workflow_call`), so there is nothing to thread. ## Verification - `bash .github/actions/pr-require-checks/check-contract/run.test.sh`: all pass, under both gawk 5.3.2 and mawk. - New cases: default rejects a tracker id and keeps the `#N` message; explicit empty input equals the default; custom pattern accepts `Closes ENG-123` and `Refs: SW2-1`; custom pattern rejects `#12` and names itself; negation (`does not close ENG-123`) fails with a custom pattern; no-issue opt-out still passes; invalid / empty-matching patterns (`([a-z`, `a)|(b`, `.*`, `(#[0-9]+)?`) exit 1 with no API call; a pattern carrying `system("touch …")` does not execute; action.yml default equals the runner default; action.yml wires the new input and env. - Mutation check: hardcoding the old regex back into the analyzer makes 7 of the new assertions fail. - `shellcheck` (repo `.shellcheckrc`), `shfmt -d`, `actionlint`, `markdownlint-cli2` on the README: clean. ## Related - melodic-software/claude-code-plugins#6994 moved PR link text into tracker adapters. claude-code-plugins itself is bound to the `github` provider (`.work-item-tracker.json`), whose adapter emits `Closes #N` / `Refs: #N`, so it needs no `with:` change; a repository bound to Jira/Linear/local-markdown would set this input after pinning a release that contains it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
What
Adds the TypeScript overlay's execution lane to the platform, the next vertical slice after the Python (ruff + pyright) overlay. TypeScript splits into two single-owner tools, exactly parallel to ruff + pyright:
actions/biome— lint + formatter (the ruff analog). Runsbiome ci --error-on-warnings --reporter=githubvianpx, pinned to Biome 2.5.1.actions/tsc— type-check only (the pyright analog). Runstsc --noEmit --project <p>vianpx --package [email protected].Biome owns lint + format + import-sorting; tsc owns type correctness — the two never double-report.
Design notes (re-derived from official docs, verified empirically)
useFindis renamed touseArrayFindandnoUnnecessaryConditions/useArraySortComparegraduated nursery→suspicious. The vendored config uses the 2.5.1 names.biome.jsonisroot: falseso it loads from the nestedmodules/typescript/path (Biome 2.x rejects a nestedroot: trueconfig). Verified to work both via--config-pathdirectly and when a consumerextendsit from a root config.pathsor the config'sfiles.includes, mirroring pyright's "no CLI exclude" stance.tsconfig.jsonis strict + ruleset-only: strict family +noUncheckedIndexedAccess,exactOptionalPropertyTypes,verbatimModuleSyntax, etc. Omitstarget/lib/module/moduleResolution/types(consumer floor/env) andnoUnusedLocals/noUnusedParameters(Biome is the single owner of unused-symbol findings).--noEmitis on the CLI, not baked in, so the base stays usable for builds.Dogfood
Both actions run in this repo's CI against the vendored config copy + a minimal good fixture, behind the
ci-statusgateway. Locally verified: good fixture passes both tools; intentionally-bad cases (carried in thestandardsrepo) flagnoConsole/noFloatingPromises(Biome) and TS7006/TS2532 (tsc).🤖 Generated with Claude Code