Repository navigation
build: lint with Oxlint - #989
Conversation
ESLint and typescript-eslint need TypeScript 6's JavaScript API, which TypeScript 7 doesn't ship. Oxlint runs the same checks natively, with its type-aware rules from oxlint-tsgolint (typescript-go). - .oxlintrc.json ports eslint.config.js: Oxlint's correctness set plus the rules ESLint's and typescript-eslint's recommended sets added, no-console, process.env, no-explicit-any, no-floating-promises and the CLI's import boundaries. Rust regexes have no lookahead, so the boundaries are gitignore-style groups. Correctness rules ESLint never ran stay off until #988. - The repo's rules move from eslint/ to lint/ and load as an Oxlint JS plugin; rules.test.ts runs on Oxlint's RuleTester. - New tier 1 and 2 patch repos lint with Oxlint: the same hooks and Preact import rules in .oxlintrc.json, one oxlint devDependency instead of three ESLint packages. The offline registry and the packed e2e probe follow. Part of #985. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of the port found three places it was looser than ESLint: - `../**` let `./../x`, `a/../b` and a bare `..` through the CLI and local-runtime import boundaries, and dropped the local runtime's `../package.json` exception. Both now match any `..` segment except `../package.json`, as the old regexes did. - Oxlint's default no-unused-vars exempts `_`-prefixed names and values read only through `typeof`; typescript-eslint reported both. - no-array-constructor, in typescript-eslint's recommended set, is pedantic in Oxlint, so correctness never turned it on. Lint scope also leaves out .jsx again, and labeler gives .oxlintrc.json area:ci, as *.config.js gave eslint.config.js. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review (GPT 6.1 Sol, xhigh) and what changed. All fixed in 03e94e9:
|
Acceptance: PASS with notesChecked Done means This accepts step 1 of #985, the lint/scaffold swap, against the PR's claims. The parent issue's TypeScript 7 compiler and publish gate belong to later steps.
Inline command evidenceThe acceptance-only harness and probes were kept outside tracked files; no PR code was changed. Heavy suites ran sequentially under the shared machine lock. The packed harness tore down its server, Postgres, browsers, and patch dev session; Golden journeys
Rollback answers: match the diff. A revert leaves newly created patch repos with builder-owned Oxlint metadata and their own lint dependency. Dev/publish do not consume that metadata. No migration, retained-data change, server/API/runtime contract, or infrastructure change requires Not run
Notes
|
## What changed The `patchy` CLI no longer bundles TypeScript to read patch repos, which makes it a third smaller. TypeScript 7 ships no JavaScript API, so this is the next step of the move (#985). `@babel/parser` reads patch sources instead, and the repo's own compiler answers what only it knows. Part of #985 (step 2 of 5). Stacked on #989. ## Look at - **`patchy add` / `patchy remove` (`editUses.ts`)** splice one entry into `uses` instead of reprinting the whole object through TypeScript's printer, which reflowed indentation and dropped or moved comments. The new entry goes after everything that follows the last entry, on a line of its own when the object ends on one. Every comment stays with the entry it follows, and removal keeps every comment not on the removed entry's own lines. Adding then removing an alias gives back the file byte for byte, LF or CRLF, with one exception: a one-line object of spaces, `{ }`, comes back as `{}`, as it does on main. The existing one-line output is unchanged: `uses: { "analytics": { kind: "posthog", handle: "product" } }`. A config that doesn't parse is refused at the line Babel stopped on. `editUses.test.ts` covers each layout, a sweep of commented layouts, the refusals and the lines they name. Acceptance's runs drove most of this: see the verdicts and replies below. - **The `agent/` typecheck warning (`serverModules.ts`)** asks the repo's own compiler for its file list with `tsc --showConfig`. That gives `include`, `exclude` and `extends` the meaning they have for `pnpm typecheck`, on TypeScript 6 or 7, instead of re-implementing them. - **The import check (`pageImports.ts`)** reads each file as Vite would. TypeScript with decorators parses with JSX outside `.ts`. Inline HTML scripts parse as plain JavaScript, classic or module, and data blocks such as JSON and import maps are skipped. Every existing form keeps its test: type-only imports and exports, import-equals, `require`, `require?.()` and `import.defer`. One deliberate tightening: the server graph refuses `import.defer()` as it already refused `import()`, because both load a module at run time. | CLI release | main | this PR | |---|---|---| | Tarball | 35.1 MB | 22.4 MB | | `dist/index.js` | 13.9 MB | 3.7 MB | | `dist/dev.js` | 16.8 MB | 6.6 MB | ## How it was verified - `editUses.test.ts`, `pageImports.test.ts`, `serverModules.test.ts` (the warning now runs the linked compiler), `packagePin.test.ts` and `ManagedProject.test.ts` pass: 151 tests. A local generator over 1,057 `uses` layouts, with LF and CRLF, checks the editor's invariants: comments stay with their entries through add and remove, output parses, and add then remove gives back the original bytes except `{ }`. It finds no failures. - `tsc` on the CLI and `pnpm typecheck:tests` pass, and `pnpm lint` is clean. - The full `packages/patchy` suite passed 595 of 618 locally. The rest failed on a loaded shared machine (load average about 17), where a stray `GET /` reached the tests' localhost stub servers. The same files fail identically on #989's head without this change, and #989's CI ran them green. CI on this head is the oracle. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required `patchy add` and `remove` write the same declarations into the same place, and now leave the rest of the file alone. A server bundle with `import.defer()` was already outside the contract ("closed modules without dynamic imports"). - **What does a revert leave behind?** Nothing. Configs edited in between are ordinary TypeScript. - **Does the release before it still work with that?** Yes. Made by Claude Opus 5.5 (Claude Code in T3 Code); reviewed by GPT 6.1 Sol. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
… 7 (#1046) ## What changed This adds release 22's What's new entry, written from `a2d1331`. It covers everything merged since release 21's `through` (`f30d8fe`), and sets the `patchy` release to `0.22.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. With this release, patch repos move to TypeScript 7 and Oxlint, and Patchy's crypto runs through one Effect service. | Change | PRs | | --- | --- | | Improved: Your agent checks patches several times faster. New repos use TypeScript 7 and Oxlint, the patchy download is a third smaller, and an existing repo's next publish asks it to move over | #989, #994, #1009, #1010 | | Behind the scenes: Patchy itself builds with TypeScript 7 and Oxlint | #989, #1009 | | Behind the scenes: Encryption, signing and ids go through one place, with tests proving stored values still open | #1000, #1041, #1042 | One merged PR gets no line: #971 is release 21's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. It tells builders that their next publish of an existing repo will ask them to move to TypeScript 7, and that live patches keep working. That's the one behaviour change people will meet. - **Rollback safety, from the live commit `2f9f7c1` (release 21) to `a2d1331`:** - No PR in the range is labelled `one-way`, and none has a migration or an infrastructure change. - Every stored format is unchanged: ids, tokens, digests, sealed credentials, file handles and index names. The crypto PRs prove this with known-answer tests. - #1010 is Breaking for builders: publishing a TypeScript 6 repo is refused, with the command to fix it. A rollback lifts that refusal, and doesn't strand anyone. - `rollback-rehearsal` passed on every landed head. **Rollback line:** If this release misbehaves, roll back to `2f9f7c1` (release 21). ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (21 tests), and prettier passes on the changed files. - **The stack.** All seven PRs were Sol-reviewed with every finding fixed, and each got an acceptance PASS or PASS with notes. Each landed after a rebase onto `main` that left it unchanged (range-diff `=`), with all 12 required checks passing. #1000's one red run was the known Fleet flake #1012, and it passed on rerun. - **Deploy state.** The live commit, pinned from `/healthz/deep`, is `2f9f7c1` (release 21). The Deploy run updated last succeeded, and none is unfinished. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. The `0.22.0` bump tells CLIs and patch repos installed before this deploy to upgrade, as every release does. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Made by Claude Opus 5.5 (Claude Code in T3 Code). Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
pnpm lintand new patch repos now lint with Oxlint instead of ESLint and typescript-eslint. typescript-eslint needs TypeScript 6's JavaScript API, which TypeScript 7 doesn't ship, so this is the first step of the TypeScript 7 move (#985). Oxlint checks the same rules, including the type-awareno-floating-promises, in a third of the time.Part of #985 (step 1 of 5).
Look at
.oxlintrc.jsonportseslint.config.jsrule for rule. It turns on Oxlint's correctness set, plus the recommended-set rules that set lacks, then the repo's own. Oxlint's correctness set also holds type-aware rules ESLint never ran here. They found 186 problems, so they stay off until Lint: work through Oxlint's correctness rules ESLint never ran #988 works through them. Rust regexes have no lookahead, so the CLI's import boundaries are gitignore-style groups:@patchy/**, then!@patchy/apiand so on, plus any..segment except../package.json.no-unused-varskeeps typescript-eslint's strictness: no_exemption, and a value read only throughtypeofcounts as unused.@patchy/auth,../../core/...).@patchy/api,@patchy/core/look,../package.json).no-explicit-any,process.env,no-console,patchy/namespace-service-importsandpatchy/no-manual-effect-runtime-in-testseach fire.no-floating-promisesfires in package source and tests,scripts/,test/,lint/and root configs. Those files have no packagetsconfig.json, so they lost no type-aware coverage.oxlintdevDependency and an.oxlintrc.jsoninstead of three ESLint packages andeslint.config.js. They keep the same three rules: hook order, exhaustive deps, and Preact throughpatchy/preact. On the packed e2e's lint probe, the scaffolded config reports all 8 forbidden imports,rules-of-hooksandexhaustive-deps, and leavesuseQuerywithout deps alone.pnpm lint, uncached, 16 coresHow it was verified
pnpm lintandpnpm typecheck:testspass, andpnpm format:checkis clean.lint/rules.test.tspasses (18 cases) on Oxlint'sRuleTester.initProject.test.ts,cliRepoPublish.test.tsand the offline tier 1 init incliRepo.test.tspass against the offline registry, which now packsoxlint.pnpm test:packed-cli-e2epasses locally against a real server. It covers a tier 1 init that installs Oxlint from npm,pnpm lint, and the lint probe.Release impact
Existing patch repos keep their ESLint setup. Lint is builder-owned, and dev and publish never load it. Only
patchy initwrites the new config.pnpm lintstill runs. Nothing on the server changes.Made by Claude Opus 5.5 (Claude Code in T3 Code); reviewed by GPT 6.1 Sol.