Skip to content

chore: Add repository tooling - #2

Merged
dcramer merged 1 commit into
mainfrom
chore/tooling
Oct 9, 2026
Merged

dcramer merged 1 commit into
mainfrom
chore/tooling

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Sets up the repo the way Junior is set up, on current tool versions. pnpm check runs everything CI runs.

Tools

  • Lint: oxlint 1.87, type-aware through oxlint-tsgolint. It enables the correctness, suspicious, and perf categories plus a few strict TypeScript rules, and fails on warnings and unused disable comments. Two rules are off:
    • no-unsafe-type-assertion: Roach parses JSON from disk and network with no schema library.
    • no-await-in-loop: Roach does sequential I/O on purpose.
  • Format: oxfmt 0.72 (Prettier-compatible), with an 80-column width to match Junior.
  • Types: TypeScript 7.0 (the native compiler) with strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, nodenext, verbatimModuleSyntax, and erasableSyntaxOnly. Node runs src/ directly with type stripping, so imports use .ts extensions.
  • Tests: Vitest 5 with v8 coverage, about 80% of lines today. knip checks for unused exports, files, and dependencies.
  • Hooks: simple-git-hooks runs lint-staged (oxlint --fix and oxfmt) before a commit and typecheck before a push.
  • Supply chain:
    • pnpm minimumReleaseAge: 1440 and an explicit allowBuilds list.
    • CI actions are pinned to SHAs, with persist-credentials: false.
    • Dependabot updates npm and Actions weekly, grouped, with a 3-day cooldown.
  • Agents:
    • AGENTS.md follows the agents-md skill, and CLAUDE.md is a symlink to it.
    • agents.toml (dotagents) pulls commit, pr-writer, code-review, find-bugs, security-review, gha-security-review, and agents-md from getsentry/skills. pnpm skills:install installs them.
  • Node: .node-version is 24, and engines is >=24.

Code changes the new checks forced

  • values.ts: the pattern builder called .sort() on the array its caller passed in, which reordered that array. It now uses toSorted(), as do the other sort calls.
  • exactOptionalPropertyTypes: optional fields that can be undefined are now typed that way.
  • Small fixes for errors in template strings, a floating promise in the CLI, one shadowed name in a test, and one unused type.
  • undici 8 no longer tunnels plain-HTTP targets by default. The tests now set proxyTunnel: true, so they still exercise CONNECT as HTTPS clients do. The "other origin" test now checks both the tunnel and absolute-form requests.

Verification: pnpm check passes locally: format, lint (0 warnings), typecheck, knip, and 11 of 11 tests. The pre-commit hook ran on this commit.

#1 (the service POC) will be rebased on top of this.

via David Cramer.

--

View Junior Session [Sentry]

Set up the tools that Junior uses, on their current versions:

- oxlint with type-aware rules (oxlint-tsgolint), and oxfmt
- TypeScript 7 with strict options, nodenext resolution, and erasable
  syntax only, so the source runs on Node type stripping
- Vitest 5 with v8 coverage, and knip for unused code and dependencies
- simple-git-hooks with lint-staged, and pnpm with a one-day minimum
  release age
- AGENTS.md (CLAUDE.md links to it), and dotagents with skills from
  getsentry/skills
- CI with pinned actions, and Dependabot with a cooldown

Fix what the new checks found. Most notably, the values pattern builder
sorted the list of its caller in place. Tests now tunnel plain HTTP, so
they still use CONNECT after undici 8 changed its default, and one test
checks absolute-form requests too.

Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer merged commit 91d82f4 into main Oct 9, 2026
13 checks passed
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