Skip to content

feat(typescript): add biome and tsc composite actions - #12

Merged
kyle-sexton merged 1 commit into
mainfrom
feat/typescript-overlay
Jun 23, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
feat/typescript-overlay

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

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). Runs biome ci --error-on-warnings --reporter=github via npx, pinned to Biome 2.5.1.
  • actions/tsc — type-check only (the pyright analog). Runs tsc --noEmit --project <p> via npx --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)

  • No verbatim port from medley. Configs re-derived against biomejs.dev and typescriptlang.org; versions confirmed against the live npm registry.
  • Biome rule drift caught: medley pinned 2.4.15; on 2.5.1 useFind is renamed to useArrayFind and noUnnecessaryConditions/useArraySortCompare graduated nursery→suspicious. The vendored config uses the 2.5.1 names.
  • biome.json is root: false so it loads from the nested modules/typescript/ path (Biome 2.x rejects a nested root: true config). Verified to work both via --config-path directly and when a consumer extends it from a root config.
  • No CLI exclude for Biome (it has none, and path args are literal — no glob/negation). Scope via paths or the config's files.includes, mirroring pyright's "no CLI exclude" stance.
  • tsconfig.json is strict + ruleset-only: strict family + noUncheckedIndexedAccess, exactOptionalPropertyTypes, verbatimModuleSyntax, etc. Omits target/lib/module/moduleResolution/types (consumer floor/env) and noUnusedLocals/noUnusedParameters (Biome is the single owner of unused-symbol findings). --noEmit is 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-status gateway. Locally verified: good fixture passes both tools; intentionally-bad cases (carried in the standards repo) flag noConsole/noFloatingPromises (Biome) and TS7006/TS2532 (tsc).

🤖 Generated with Claude Code

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]>
@kyle-sexton
kyle-sexton merged commit 01b34dc into main Jun 23, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the feat/typescript-overlay branch June 23, 2026 13:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

kyle-sexton added a commit that referenced this pull request Oct 11, 2026
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]>
kyle-sexton added a commit that referenced this pull request Oct 11, 2026
)

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]>
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.

1 participant