diff --git a/.agents/docs/architecture/auth-and-permissions.md b/.agents/docs/architecture/auth-and-permissions.md
index 89004cc3b2..3a2c7278af 100644
--- a/.agents/docs/architecture/auth-and-permissions.md
+++ b/.agents/docs/architecture/auth-and-permissions.md
@@ -15,8 +15,8 @@ that they may read _some_ subject; the `where` decides whether they may read _th
## Layer 1: `@RouteAccess`
-`REQUIRE_ROUTE_ACCESS` in the root `eslint.config.js` flags a handler without one; the guard turns a
-missing one into a 500. Nothing checks the value. Routes whose declaration is not the ordinary
+`opendatacapture/require-route-access` (`packages/oxlint-config/src/rules/`) flags a handler without
+one; the guard turns a missing one into a 500. Nothing checks the value. Routes whose declaration is not the ordinary
`{ action, subject }` on the model they serve:
| Route | Declaration | Why it is safe |
diff --git a/.agents/docs/architecture/testing-strategy.md b/.agents/docs/architecture/testing-strategy.md
index 3c9bab04e6..0a0552a0d9 100644
--- a/.agents/docs/architecture/testing-strategy.md
+++ b/.agents/docs/architecture/testing-strategy.md
@@ -34,7 +34,7 @@ project. Before trusting a new test, see it listed and watch it fail on purpose.
## Vitest projects
-Twenty-two, each named after its directory except `runtime/v1` (`runtime-v1`) and `.github` (`github`). Quirks of each live in
+Twenty-three, each named after its directory except `runtime/v1` (`runtime-v1`) and `.github` (`github`). Quirks of each live in
that package's `AGENTS.md` §Tests. Three run under happy-dom; the rest run in node, where one file
opts into a DOM with a first-line `// @vitest-environment happy-dom` docblock.
@@ -50,6 +50,7 @@ opts into a DOM with a first-line `// @vitest-environment happy-dom` docblock.
| `instrument-library` | `packages/instrument-library` | happy-dom; aliases `/runtime/v1/…` to sources, no build |
| `instrument-stubs` | `packages/instrument-stubs` | tests are `.test.js` |
| `instrument-utils` | `packages/instrument-utils` | |
+| `oxlint-config` | `packages/oxlint-config` | `RuleTester` from `oxlint/plugins-dev` |
| `playground-url` | `packages/playground-url` | |
| `react-core` | `packages/react-core` | happy-dom |
| `release-info` | `packages/release-info` | |
@@ -91,15 +92,15 @@ outside the project globs by design.
## `pnpm lint` is the type-check, and it edits files
-Per-package `lint` is `tsc && eslint --fix src`; there is no separate `typecheck` script, so a type
+Per-package `lint` is `tsc && oxlint --fix src`; there is no separate `typecheck` script, so a type
error surfaces as a lint failure and every run may rewrite the working tree. Exceptions:
| Package | `lint` |
| ------------------------------------------------------------- | ------------------------------------------ |
-| `apps/outreach` | `astro check && eslint --fix src` |
-| `packages/runtime-core` | `tsc --noEmit && eslint --fix src` |
-| `packages/instrument-stubs`, `packages/instrument-guidelines` | eslint only — **no `tsc`** |
-| `testing` | `pnpm gen:routes && tsc && eslint --fix .` |
+| `apps/outreach` | `astro check && oxlint --fix src` |
+| `packages/runtime-core` | `tsc --noEmit && oxlint --fix src` |
+| `packages/instrument-stubs`, `packages/instrument-guidelines` | oxlint only — **no `tsc`** |
+| `testing` | `pnpm gen:routes && tsc && oxlint --fix .` |
| `runtime/v1` | **none**, so never type-checked |
## Turbo task graph
@@ -107,7 +108,8 @@ error surfaces as a lint failure and every run may rewrite the working tree. Exc
`lint`, `dev`, `dev:test` and `test:e2e` depend on `["^build", "^db:generate", "db:push"]`; `build`
on `["^build", "db:generate"]`. `test:e2e` is `cache: false`. **`test` is not a turbo task**: root
`pnpm test` is `env-cmd vitest`, with no build and no database. `globalDependencies` (`.env`,
-`eslint.config.js`, `tsconfig.json`, `prettier.config.js`) invalidate every cached task when touched.
+`oxfmt.config.ts`, `oxlint.config.ts`, `packages/oxlint-config/src/**`, `tsconfig.json`) invalidate
+every cached task when touched.
## Coverage scope
@@ -124,7 +126,7 @@ counts their functions twice in the merged report.
`pnpm lint`, `pnpm test:coverage`, Playwright install (chromium + firefox, capped at 10 minutes, after
lint and unit tests so a hung download cannot hide them), `pnpm test:e2e`.
-Not gated: knip (`pnpm knip` exists), and formatting — prettier runs only in the `.husky/pre-commit`
+Not gated: knip (`pnpm knip` exists), and formatting — oxfmt runs only in the `.husky/pre-commit`
hook, which formats rather than verifies.
`.github/workflows/release.yaml` (push to `main`, dispatch on `release/`) validates with `pnpm lint` only — **no unit or e2e
diff --git a/.agents/docs/index.md b/.agents/docs/index.md
index 94381e2b3f..2e4247adba 100644
--- a/.agents/docs/index.md
+++ b/.agents/docs/index.md
@@ -15,6 +15,7 @@ Read the `AGENTS.md` in the directory you are editing; each covers only that wor
| Building the library catalog instruments import | `packages/runtime-bundler/AGENTS.md` |
| The `defineInstrument` public API | `packages/runtime-core/AGENTS.md` |
| Adding or editing a built-in instrument | `packages/instrument-library/AGENTS.md` |
+| Lint rules and the custom oxlint plugin | `packages/oxlint-config/AGENTS.md` |
| Pinned library wrappers instruments import | `vendor/AGENTS.md` |
| The published runtime artifact | `runtime/v1/AGENTS.md` |
| End-to-end tests | `testing/AGENTS.md` |
@@ -33,7 +34,7 @@ isn't one.
| Topic | Path |
| --------------------------------------------------------------- | --------------------------------------------------- |
| Which workspace depends on which, what is built, what publishes | `.agents/docs/workspace-map.md` |
-| The 11 `@douglasneuroinformatics/*` packages this repo consumes | `.agents/docs/packages/index.md` |
+| The 9 `@douglasneuroinformatics/*` packages this repo consumes | `.agents/docs/packages/index.md` |
| Instrument source → bundle → store → interpret → render | `.agents/docs/architecture/instrument-pipeline.md` |
| The six similarly-named `runtime-*` things, and `vendor/` | `.agents/docs/architecture/runtime-and-vendor.md` |
| CASL, `@RouteAccess`, and group scoping | `.agents/docs/architecture/auth-and-permissions.md` |
diff --git a/.agents/docs/packages/index.md b/.agents/docs/packages/index.md
index 22c3be7a88..d531b90a50 100644
--- a/.agents/docs/packages/index.md
+++ b/.agents/docs/packages/index.md
@@ -1,6 +1,6 @@
# Internal DNP packages
-The 11 `@douglasneuroinformatics/*` packages, maintained in separate repos. Use this file to find
+The 9 `@douglasneuroinformatics/*` packages, maintained in separate repos. Use this file to find
which one already does what you need, then read that package's source for the API. This file does
not copy APIs, because copies drift.
@@ -13,21 +13,19 @@ not copy APIs, because copies drift.
| `libui-form-types` | the `FormTypes` declarative-form types. Instrument code uses runtime-core's `FormInstrument` types, which wrap these | runtime-core, and libui's `Form` |
| `libnest` | the Nest layer of `apps/api`: bootstrap, config, Prisma models, validation pipes, logging, crypto, virtualization, test doubles (`./testing`). `apps/api/AGENTS.md` covers how the app uses it | api |
| `libui` | React/Tailwind components, hooks (`useTranslation`, `useNotificationsStore`, …), `cn`, i18n, `CoreProvider`. It has no root export: import `./components`, `./hooks`, `./utils`, `./i18n`, `./providers` or `./tailwind/globals.css` | web, gateway, playground, outreach, react-core, serve-instrument |
-| `eslint-config` | the `config()` factory behind the root `eslint.config.js` | root |
-| `prettier-config` | `createConfig()` behind the root `prettier.config.js`, and the `prettier-pre-commit` bin that `.husky/pre-commit` runs | root |
| `tsconfig` | the base that the root `tsconfig.json` extends. It sets `noEmit: true`, so the `tsc` in every `lint` script only typechecks | root |
| `esbuild-plugin-prisma` | `prismaPlugin({ outdir })`, which copies Prisma's query engine next to an esbuild bundle | gateway's `scripts/build.ts` |
## Reading the source
-Resolve a package through a workspace in its "Used in" column. Only `eslint-config`,
-`prettier-config` and `tsconfig` are linked at the repo root. For example:
+Resolve a package through a workspace in its "Used in" column. Only `tsconfig` is
+linked at the repo root. For example:
`apps/api/node_modules/@douglasneuroinformatics/libnest/src/index.ts`.
- `libnest`, `libui`, `libcrypto`, `libpasswd`: original TypeScript under `src/`.
-- `prettier-config`, `esbuild-plugin-prisma`: JSDoc-typed `.js` under `src/`, plus a hand-written
+- `esbuild-plugin-prisma`: JSDoc-typed `.js` under `src/`, plus a hand-written
`.d.ts`.
-- `libjs`, `eslint-config`: `dist/` only, but unbundled and unminified with JSDoc intact, one file
+- `libjs`: `dist/` only, but unbundled and unminified with JSDoc intact, one file
per module.
- `libui-form-types`, `tsconfig`: the published file is the whole package (`lib/index.d.ts`,
`tsconfig.json`).
diff --git a/.agents/docs/playbooks/add-e2e-test.md b/.agents/docs/playbooks/add-e2e-test.md
index c2b48fa146..0bbf1b5618 100644
--- a/.agents/docs/playbooks/add-e2e-test.md
+++ b/.agents/docs/playbooks/add-e2e-test.md
@@ -23,7 +23,7 @@ starting — `playwright.config.ts` boots api, gateway, web and playground itsel
4. **Register it in `pageModels` in `testing/src/support/fixtures.ts`** if the spec navigates to it with
`getPageModel`, keyed by the route literal — `'/datahub/subjects/$subjectId/assignments':
-SubjectAssignmentsPage`. A page reached by clicking through needs no entry; use `new XPage(page)`.
+ SubjectAssignmentsPage`. A page reached by clicking through needs no entry; use `new XPage(page)`.
5. **Write the spec** at `testing/src/specs/.spec.ts`, importing
`import { expect, test } from '../support/fixtures';`. With the raw `@playwright/test` import, a
@@ -44,7 +44,7 @@ SubjectAssignmentsPage`. A page reached by clicking through needs no entry; use
## Verify
```sh
-pnpm --filter @opendatacapture/testing lint # gen:routes, tsc, eslint .
+pnpm --filter @opendatacapture/testing lint # gen:routes, tsc, oxlint .
pnpm --filter @opendatacapture/testing test:e2e --list src/specs/.spec.ts # your titles, under [chromium]
pnpm --filter @opendatacapture/testing test:e2e src/specs/.spec.ts # one spec; setup still runs
pnpm test:e2e # whole suite, from repo root
diff --git a/.agents/docs/playbooks/add-env-var.md b/.agents/docs/playbooks/add-env-var.md
index 6aabef96f7..84ebb9503e 100644
--- a/.agents/docs/playbooks/add-env-var.md
+++ b/.agents/docs/playbooks/add-env-var.md
@@ -32,7 +32,7 @@
or give it a `.default()`. A cross-field requirement goes in the `.transform((env, ctx) => ...)` at
the bottom of `$Env` via `ctx.addIssue`; the `STORAGE_ENABLED` block is the pattern.
-5. **Read it as `this.configService.get('YOUR_KEY')`.** `process.env` is an eslint error in
+5. **Read it as `this.configService.get('YOUR_KEY')`.** `process.env` is an oxlint error in
`apps/api/src`; do not add a second exception to
`src/core/decorators/throttle-login-request.decorator.ts`. To gate a whole module on a boolean, use
`{ module: XModule, when: 'YOUR_KEY' }` in the `imports` array of `apps/api/src/main.ts`.
diff --git a/.agents/docs/playbooks/add-vitest-project.md b/.agents/docs/playbooks/add-vitest-project.md
index 1c56500a54..a5b6e50109 100644
--- a/.agents/docs/playbooks/add-vitest-project.md
+++ b/.agents/docs/playbooks/add-vitest-project.md
@@ -46,7 +46,7 @@ project, so its test files are collected by nothing and CI stays green. The loud
devDependency — ask first per the root rule, then `pnpm install`. Redeclare under `resolve.alias`
any alias the source imports; `vite.config.ts` is not loaded during tests.
-5. **Add `vitest.config.ts` to the package's `tsconfig.json` `include`.** Package eslint runs on `src`
+5. **Add `vitest.config.ts` to the package's `tsconfig.json` `include`.** Package oxlint runs on `src`
only, so `tsc` is the config's only check. Tests in `test/` rather than `src/` need `test/**/*.ts`
there too (`packages/runtime-bundler`), or nothing type-checks them.
diff --git a/.agents/docs/playbooks/promote-to-react-core.md b/.agents/docs/playbooks/promote-to-react-core.md
index 243be69010..6cffd9cd53 100644
--- a/.agents/docs/playbooks/promote-to-react-core.md
+++ b/.agents/docs/playbooks/promote-to-react-core.md
@@ -39,7 +39,7 @@ done; `apps/web`'s until step 9.
6. **Repoint every `@/…` import.** react-core has no `@` alias, and neither does Storybook for files
here. `@/components/*` becomes a relative sibling import; `@/store`, `@/hooks/*`, `@/config`,
`@/services/*` and `@/utils/*` become props per step 5. A relative path climbing into
- `apps/web/src` typechecks and no eslint rule forbids it — nothing under `src/` may resolve outside
+ `apps/web/src` typechecks and no oxlint rule forbids it — nothing under `src/` may resolve outside
the package.
7. **Declare every remaining bare import in `packages/react-core/package.json`** (`@heroicons/react`,
diff --git a/.agents/docs/playbooks/run-locally.md b/.agents/docs/playbooks/run-locally.md
index 844b4f0a2a..50a9a28913 100644
--- a/.agents/docs/playbooks/run-locally.md
+++ b/.agents/docs/playbooks/run-locally.md
@@ -51,7 +51,7 @@ one.
Done when `rs.status().ok` returns 1.
6. **`pnpm install`.** It also installs the husky pre-commit hook, which formats staged files with
- prettier and runs neither lint nor tests.
+ oxfmt and runs neither lint nor tests.
7. **Run `pnpm build` once.** `runtime/v1/dist` is gitignored and read while Vite configs load, so a
dev server started without it dies with
diff --git a/.agents/docs/workspace-map.md b/.agents/docs/workspace-map.md
index 68c20d340b..efa0a47bca 100644
--- a/.agents/docs/workspace-map.md
+++ b/.agents/docs/workspace-map.md
@@ -22,6 +22,7 @@ The five `apps/*`, `storybook` and `testing` are leaves: no workspace depends on
| `instrument-stubs` | Minimal stub instruments for tests | react-core, schemas, web |
| `instrument-utils` | Helpers for working with instrument definitions | api, react-core, web |
| `licenses` | SPDX and custom license metadata | outreach, runtime-core, runtime-v1, schemas, web |
+| `oxlint-config` | The base oxlint config and the repo's custom-rule plugin (`opendatacapture/*`) | root `oxlint.config.ts` |
| `playground-url` | Encodes and decodes shareable playground URLs | playground, testing |
| `react-core` | Components and hooks shared by more than one frontend | gateway, playground, serve-instrument, storybook, web |
| `release-info` | Resolves version, branch and commit at build time | api, gateway, web |
diff --git a/.agents/skills/finishing-changes/SKILL.md b/.agents/skills/finishing-changes/SKILL.md
index aa96f62640..bc87b00c74 100644
--- a/.agents/skills/finishing-changes/SKILL.md
+++ b/.agents/skills/finishing-changes/SKILL.md
@@ -22,7 +22,7 @@ for unit tests). A diff spanning rows runs each row's checks; any other file mea
`pnpm lint`, `pnpm test:coverage` and `pnpm test:e2e` in sequence, so a lint failure hides the rest until it
is fixed. `pnpm test:e2e` needs its browsers installed once per machine
(`.agents/docs/playbooks/add-e2e-test.md`).
-2. **After it, read `git status`.** `eslint --fix` rewrites as it checks; the rewrites are your own code being
+2. **After it, read `git status`.** `oxlint --fix` rewrites as it checks; the rewrites are your own code being
sorted, so keep them. TS2345 on a route literal you added is an exception until the user regenerates
`route-tree.ts` (`.agents/docs/playbooks/add-web-route.md`); revert any `route-tree.ts` diff. Because that
failure stops `pnpm check` at lint, run `pnpm test:coverage` directly and leave `pnpm test:e2e` for after
diff --git a/.agents/skills/troubleshooting/SKILL.md b/.agents/skills/troubleshooting/SKILL.md
index 7b638419cf..d8be485ef6 100644
--- a/.agents/skills/troubleshooting/SKILL.md
+++ b/.agents/skills/troubleshooting/SKILL.md
@@ -12,7 +12,7 @@ that is deliberately left alone is recorded in the owning workspace's `AGENTS.md
- **TS2345 on a route literal you just added** is expected until the user regenerates `route-tree.ts`
(`.agents/docs/playbooks/add-web-route.md`). Every Vite run in `apps/web` (`dev`, `dev:test`, the Playwright
webServer, `vite build`) rewrites that tracked file; if `git status` shows it after a debugging run, revert it.
-- **`pnpm lint` passed and the tree changed**: `eslint --fix` sorted your new code. Keep the rewrite.
+- **`pnpm lint` passed and the tree changed**: `oxlint --fix` sorted your new code. Keep the rewrite.
- **`Failed to find .env file at default paths`**: run `pnpm generate:env` (root `AGENTS.md`).
- **ENOENT while a Vite config resolves, or `/runtime/v1/*` unresolved**: `runtime/v1/dist` is unbuilt. Turbo
builds it; a bare `tsc`, `vitest` or storybook does not (`.agents/docs/playbooks/run-locally.md`).
diff --git a/.eslint/rules/index.js b/.eslint/rules/index.js
deleted file mode 100644
index 754a2e2401..0000000000
--- a/.eslint/rules/index.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { classNameComposition } from './class-name-composition.js';
-import { handlerNames } from './handler-names.js';
-import { multilineArrowBody } from './multiline-arrow-body.js';
-import { noCoverageIgnore } from './no-coverage-ignore.js';
-import { requireDisableReason } from './require-disable-reason.js';
-import { routeExports } from './route-exports.js';
-import { unitTestSubject } from './unit-test-subject.js';
-
-export const rules = {
- 'class-name-composition': classNameComposition,
- 'handler-names': handlerNames,
- 'multiline-arrow-body': multilineArrowBody,
- 'no-coverage-ignore': noCoverageIgnore,
- 'require-disable-reason': requireDisableReason,
- 'route-exports': routeExports,
- 'unit-test-subject': unitTestSubject
-};
diff --git a/.husky/pre-commit b/.husky/pre-commit
index b956e64695..497616f4ff 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1,12 @@
-prettier-pre-commit
+STAGED_FILES=$(mktemp)
+trap 'rm -f "$STAGED_FILES"' EXIT
+
+git diff --cached --name-only --diff-filter=ACMR -z > "$STAGED_FILES"
+
+# Given no path, oxfmt formats the whole working directory
+[ -s "$STAGED_FILES" ] || exit 0
+
+xargs -0 pnpm exec oxfmt --no-error-on-unmatched-pattern < "$STAGED_FILES"
+
+# Add the formatted files back to staging
+xargs -0 git add < "$STAGED_FILES"
diff --git a/.prettierignore b/.prettierignore
deleted file mode 100644
index 71d1ecaa76..0000000000
--- a/.prettierignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Add files here to ignore them from prettier formatting
-
-/dist
-/coverage
-.claude/skills
-apps/web/src/route-tree.ts
-# Regenerated by pnpm on every install; formatting it just churns the diff
-pnpm-lock.yaml
\ No newline at end of file
diff --git a/AGENTS.md b/AGENTS.md
index dc06b835ca..f3c36e8c44 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,7 +1,7 @@
# Open Data Capture
An electronic data capture platform for administering remote and in-person clinical instruments.
-It is a pnpm/Turborepo monorepo written in TypeScript: 27 first-party workspaces under `apps/`,
+It is a pnpm/Turborepo monorepo written in TypeScript: 28 first-party workspaces under `apps/`,
`packages/`, `runtime/`, `storybook/` and `testing/`, plus 38 thin version-pinned wrappers under
`vendor/` that are also workspaces.
@@ -18,8 +18,8 @@ pnpm install # install deps
pnpm generate:env # create .env from .env.template — required before anything else runs
pnpm dev # run core apps (api, gateway, web) via turbo
pnpm build # turbo build (all packages/apps)
-pnpm lint # turbo lint — `tsc && eslint --fix src` per package, plus lint:root for root-level scripts and configs
-pnpm format # turbo format (prettier per package)
+pnpm lint # turbo lint — `tsc && oxlint --fix src` per package, plus lint:root for root-level scripts and configs
+pnpm format # turbo format (oxfmt per package)
pnpm test # vitest across the workspace
pnpm test:coverage # vitest with coverage — fails below 100%, the gate CI runs
pnpm test:e2e # playwright, in testing/
@@ -87,8 +87,8 @@ Outside call sites, an assertion the lint flags (`as`, `!`) is allowed only when
Advanced type-level constructs (e.g., conditional types, template literal types, inference extraction, mapped types) are a routine tool.
**Tests.** A unit test is `.test.ts(x)` in a `__tests__/` folder beside the file it tests, or
-in a package's `test/` folder when it drives the whole package; eslint enforces the layout
-(`odc/unit-test-subject` in `.eslint/rules/`, beside the repo's other custom rules). Keep test
+in a package's `test/` folder when it drives the whole package; oxlint enforces the layout
+(`opendatacapture/unit-test-subject` in `packages/oxlint-config/src/rules/`, beside the repo's other custom rules). Keep test
bodies short; each verifies one behavior. Descriptions are concise, grammatical sentences stating
the behavioral reason, e.g. `'should key the cache on every parameter, so paging does not serve a
stale page'`.
diff --git a/apps/api/AGENTS.md b/apps/api/AGENTS.md
index 20c76af783..1609cd81e9 100644
--- a/apps/api/AGENTS.md
+++ b/apps/api/AGENTS.md
@@ -45,7 +45,7 @@ src//
There is no repository layer and no `entity/` folder — `Model<'X'>` _is_ the repository.
**A single-segment route can be shadowed by a `:param` route on the same verb.** `perfectionist/sort-classes`
-is an eslint error, so `eslint --fix` orders controller handlers alphabetically — a handler you wrote
+is an oxlint error, so `oxlint --fix` orders controller handlers alphabetically — a handler you wrote
above `@Get(':id')` does not stay there. Anything that sorts below it, such as a hypothetical
`@Get('summary')` in `users.controller.ts`, is matched by `:id` instead, and the failure is a
confusing 404 or cast error rather than a lint or type failure. Give such a route two segments so
@@ -64,7 +64,7 @@ check _which rows_.
**1. Every handler needs `@RouteAccess`.** A handler without one throws
`InternalServerErrorException` at request time — so the failure mode is a 500, not an accidentally
-public route. This is eslint-enforced. Know what you are choosing:
+public route. This is oxlint-enforced. Know what you are choosing:
| Value | Means |
| ----------------------------------- | --------------------------------------------------------------------------------------------- |
@@ -98,7 +98,7 @@ off it, and its controller forwards `@CurrentUser()` — `src/instruments/instru
`accessibleQuery(undefined, ...)` returns `{}` — **an omitted or undefined ability means no
restriction**, which reads clinical data across every group. Nothing catches this: not `tsc`, not
-eslint, not a passing test suite. It is the single highest-severity mistake available in this
+oxlint, not a passing test suite. It is the single highest-severity mistake available in this
codebase, so verify the `where` clause of any query you add or edit.
The defined case has the opposite failure mode: **an ability holding no rule at all for the queried
@@ -220,7 +220,7 @@ in one and not the other type-checks on both sides and fails when a document is
## Configuration
All environment variables are declared in `$Env` (`src/core/schemas/env.schema.ts`) and read through
-`ConfigService`. **Reading `process.env` directly is an eslint error** — the one exception is
+`ConfigService`. **Reading `process.env` directly is an oxlint error** — the one exception is
`src/core/decorators/throttle-login-request.decorator.ts`, where decorator arguments are evaluated
before the DI container exists.
diff --git a/apps/api/package.json b/apps/api/package.json
index 3af58c4c66..9e3d601dca 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -1,16 +1,22 @@
{
"name": "@opendatacapture/api",
- "type": "module",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
+ "type": "module",
+ "imports": {
+ "#runtime/v1/*": {
+ "development": "../../runtime/v1/dist/*",
+ "default": "./dist/runtime/v1/*"
+ }
+ },
"scripts": {
"build": "rm -rf dist && NODE_ENV=production libnest build -c libnest.config.ts",
"db:generate": "prisma generate --no-hints",
"dev": "NODE_ENV=development NODE_OPTIONS='--conditions=development' env-cmd -f ../../.env libnest dev -c libnest.config.ts",
"dev:test": "NODE_ENV=test env-cmd -f ../../.env env STORAGE_ENABLED=true libnest dev -c libnest.config.ts --no-watch",
- "format": "prettier --write src test",
- "lint": "tsc && eslint --fix src test",
+ "format": "oxfmt src test",
+ "lint": "tsc && oxlint --fix src test",
"start": "NODE_ENV=production env-cmd -f ../../.env node dist/app.js",
"test": "env-cmd -f ../../.env vitest"
},
@@ -21,7 +27,7 @@
"@casl/prisma": "^2.0.2",
"@douglasneuroinformatics/libcrypto": "catalog:",
"@douglasneuroinformatics/libjs": "catalog:",
- "@douglasneuroinformatics/libnest": "^10.0.0",
+ "@douglasneuroinformatics/libnest": "^11.0.0",
"@douglasneuroinformatics/libpasswd": "catalog:",
"@douglasneuroinformatics/libstats": "catalog:",
"@faker-js/faker": "^10.6.0",
@@ -65,12 +71,6 @@
"@types/passport-jwt": "^4.0.1",
"mongodb-memory-server": "^11.3.0",
"prisma": "catalog:",
- "prisma-json-types-generator": "^3.2.2"
- },
- "imports": {
- "#runtime/v1/*": {
- "development": "../../runtime/v1/dist/*",
- "default": "./dist/runtime/v1/*"
- }
+ "prisma-json-types-generator": "catalog:"
}
}
diff --git a/apps/api/src/auth/__tests__/auth.service.test.ts b/apps/api/src/auth/__tests__/auth.service.test.ts
index 4077d937a2..70aa8020e5 100644
--- a/apps/api/src/auth/__tests__/auth.service.test.ts
+++ b/apps/api/src/auth/__tests__/auth.service.test.ts
@@ -45,7 +45,8 @@ describe('AuthService', () => {
/** The permissions the minted token actually carries, read back off the signed payload. */
const mintedPermissions = async (currentUser: RequestUser): Promise => {
await authService.getCreateInstrumentToken(currentUser);
- return (jwtService.signAsync.mock.lastCall?.[0] as { permissions: Permission[] }).permissions;
+ const [payload] = jwtService.signAsync.mock.lastCall ?? [];
+ return (payload as { permissions: Permission[] }).permissions;
};
beforeEach(() => {
diff --git a/apps/api/src/core/decorators/throttle-login-request.decorator.ts b/apps/api/src/core/decorators/throttle-login-request.decorator.ts
index 7a744400ee..c15732f941 100644
--- a/apps/api/src/core/decorators/throttle-login-request.decorator.ts
+++ b/apps/api/src/core/decorators/throttle-login-request.decorator.ts
@@ -11,13 +11,13 @@ import { DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT, DEFAULT_LOGIN_REQUEST_THROTTLER_
const LOGIN_REQUEST_THROTTLER_LIMIT = $NumberLike
.pipe(z.number().int().positive())
.default(DEFAULT_LOGIN_REQUEST_THROTTLER_LIMIT)
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-restricted-syntax -- ConfigService does not exist when decorator arguments are evaluated, and || maps an empty variable to the default
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-restricted-properties -- ConfigService does not exist when decorator arguments are evaluated, and || maps an empty variable to the default
.parse(process.env.LOGIN_REQUEST_THROTTLER_LIMIT || undefined);
const LOGIN_REQUEST_THROTTLER_TTL = $NumberLike
.pipe(z.number().int().positive())
.default(DEFAULT_LOGIN_REQUEST_THROTTLER_TTL)
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-restricted-syntax -- ConfigService does not exist when decorator arguments are evaluated, and || maps an empty variable to the default
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-restricted-properties -- ConfigService does not exist when decorator arguments are evaluated, and || maps an empty variable to the default
.parse(process.env.LOGIN_REQUEST_THROTTLER_TTL || undefined);
export function ThrottleLoginRequest() {
diff --git a/apps/api/src/instrument-repos/instrument-repos.service.ts b/apps/api/src/instrument-repos/instrument-repos.service.ts
index b356e22afe..4618a2d040 100644
--- a/apps/api/src/instrument-repos/instrument-repos.service.ts
+++ b/apps/api/src/instrument-repos/instrument-repos.service.ts
@@ -590,7 +590,8 @@ export class InstrumentReposService implements OnModuleInit {
private recordSync(
entry: { action: InstrumentRepoSyncAction; repoId: null | string; repoName: string } & (
- { error: unknown } | { result: RepoImportResult }
+ | { error: unknown }
+ | { result: RepoImportResult }
)
) {
const { action, repoId, repoName } = entry;
diff --git a/apps/api/src/mail/__tests__/mail.service.test.ts b/apps/api/src/mail/__tests__/mail.service.test.ts
index b2f754e65f..3d99789ca9 100644
--- a/apps/api/src/mail/__tests__/mail.service.test.ts
+++ b/apps/api/src/mail/__tests__/mail.service.test.ts
@@ -54,10 +54,8 @@ describe('MailService', () => {
/** The password as it would come back out of the database. */
const persistedPassword = () => {
- return decryptSecret(
- (setupStateModel.update.mock.lastCall?.[0] as PersistedUpdate).data.mailConfig.set.password,
- SECRET_KEY
- );
+ const [update] = setupStateModel.update.mock.lastCall ?? [];
+ return decryptSecret((update as PersistedUpdate).data.mailConfig.set.password, SECRET_KEY);
};
beforeEach(async () => {
@@ -160,7 +158,8 @@ describe('MailService', () => {
it('encrypts the password before it reaches the database', async () => {
setupStateModel.findFirst.mockResolvedValue({ id: '1', isSetup: true, mailConfig: stored(validConfig) });
await mailService.updateSettings({ config: { ...validConfig, password: 'new-secret' } });
- const written = (setupStateModel.update.mock.lastCall?.[0] as PersistedUpdate).data.mailConfig.set.password;
+ const [update] = setupStateModel.update.mock.lastCall ?? [];
+ const written = (update as PersistedUpdate).data.mailConfig.set.password;
expect(written).not.toBe('new-secret');
expect(written).not.toContain('new-secret');
expect(decryptSecret(written, SECRET_KEY)).toBe('new-secret');
diff --git a/apps/gateway/AGENTS.md b/apps/gateway/AGENTS.md
index f68a157a03..14a99da26e 100644
--- a/apps/gateway/AGENTS.md
+++ b/apps/gateway/AGENTS.md
@@ -109,7 +109,7 @@ hydrated tree can disagree with the SSR'd HTML until you do.
- `@/` aliases `src/`, declared in both `vite.config.ts` and `tsconfig.json`.
- Ambient declarations live in `src/typings/` and `src/vite-env.d.ts`: `res.locals.loadRoot`,
`window.__ROOT_PROPS__`, the `cap-widget` JSX element, `__RELEASE__`.
-- The eslint blocks for `apps/web` and `packages/react-core` (no default exports, no bare `clsx`,
+- The oxlint blocks for `apps/web` and `packages/react-core` (no default exports, no bare `clsx`,
`jsx-no-literals`) **do not cover this app**, and default exports are in use. Translation is still
required, and there are no translation resource files — `src/services/i18n.ts` initializes with
`{}`, so every string is inline `t({ en, es, fr })`. Every interface language needs an entry;
diff --git a/apps/gateway/package.json b/apps/gateway/package.json
index e640d51f0e..e76af064e0 100644
--- a/apps/gateway/package.json
+++ b/apps/gateway/package.json
@@ -1,9 +1,9 @@
{
"name": "@opendatacapture/gateway",
- "type": "module",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
+ "type": "module",
"scripts": {
"build": "rm -rf dist && pnpm build:client && pnpm build:server && NODE_ENV=production tsx scripts/build.ts",
"build:client": "vite build --ssrManifest --outDir dist/client",
@@ -12,8 +12,8 @@
"db:push": "env-cmd --silent -f ../../.env prisma db push --skip-generate",
"dev": "NODE_ENV=development env-cmd -f ../../.env tsx scripts/dev.ts && env-cmd -f ../../.env node dist/main.js",
"dev:test": "NODE_ENV=test env-cmd -f ../../.env tsx scripts/dev.ts && env-cmd -f ../../.env node dist/main.js",
- "format": "prettier --write src",
- "lint": "tsc && eslint --fix src",
+ "format": "oxfmt src",
+ "lint": "tsc && oxlint --fix src",
"test": "env-cmd -f ../../.env vitest",
"start": "NODE_ENV=production env-cmd -f ../../.env node dist/main.js"
},
diff --git a/apps/outreach/AGENTS.md b/apps/outreach/AGENTS.md
index c937f1a4bd..a32ceb12b0 100644
--- a/apps/outreach/AGENTS.md
+++ b/apps/outreach/AGENTS.md
@@ -101,7 +101,7 @@ Tailwind v4 via `@tailwindcss/vite`. Two dark-mode attributes coexist: marketing
syncs them. Style against `data-mode` outside of Starlight.
`cn` comes from the local `src/utils.ts`, which wraps clsx and tailwind-merge directly. That is
-deliberate; the eslint ban on importing those two applies only to `apps/web` and
+deliberate; the oxlint ban on importing those two applies only to `apps/web` and
`packages/react-core`.
## No React, no tests
@@ -110,5 +110,8 @@ Every component is `.astro`; there are no React islands and no client framework
configured. Do not introduce one without asking.
There is **no `vitest.config.ts` and no test suite in this package** — `pnpm test` does not cover it.
-`pnpm --filter @opendatacapture/outreach lint` runs `astro check && eslint --fix src`, and `astro check`
+`pnpm --filter @opendatacapture/outreach lint` runs `astro check && oxlint --fix src`, and `astro check`
is the only thing type-checking `.astro` files, so run it after any change here.
+
+`astro check` and typedoc run on this package's own `typescript` 6.0.x devDependency: neither supports
+TypeScript 7, which every other workspace uses.
diff --git a/apps/outreach/package.json b/apps/outreach/package.json
index 67a9564c23..abf2ee452e 100644
--- a/apps/outreach/package.json
+++ b/apps/outreach/package.json
@@ -1,14 +1,14 @@
{
"name": "@opendatacapture/outreach",
- "type": "module",
"version": "0.0.0",
+ "type": "module",
"scripts": {
"astro": "astro",
"build": "astro build",
"dev": "astro dev",
- "format": "prettier --write src",
+ "format": "oxfmt src",
"format:translations": "find src/i18n/translations -name '*.json' -exec pnpm exec sort-json {} \\;",
- "lint": "astro check && eslint --fix src"
+ "lint": "astro check && oxlint --fix src"
},
"dependencies": {
"@douglasneuroinformatics/libui": "catalog:",
@@ -36,6 +36,7 @@
"sharp": "^0.35.5",
"tailwindcss": "catalog:",
"typedoc": "^0.28.20",
- "typedoc-plugin-markdown": "^4.13.1"
+ "typedoc-plugin-markdown": "^4.13.1",
+ "typescript": "6.0.x"
}
}
diff --git a/apps/outreach/src/components/blog/PostInfoCard.astro b/apps/outreach/src/components/blog/PostInfoCard.astro
index 373fea7711..363949cc88 100644
--- a/apps/outreach/src/components/blog/PostInfoCard.astro
+++ b/apps/outreach/src/components/blog/PostInfoCard.astro
@@ -7,12 +7,12 @@ import Headshot from '../common/Headshot.astro';
type Props = {
author: CollectionEntry<'team'>;
+ className?: string;
datePublished: Date;
readingTime: number;
- className?: string;
};
-const { author, datePublished, readingTime, className } = Astro.props;
+const { author, className, datePublished, readingTime } = Astro.props;
const { resolvedLanguage, t } = useTranslations(Astro.url);
---
@@ -26,11 +26,9 @@ const { resolvedLanguage, t } = useTranslations(Astro.url);
diff --git a/apps/outreach/src/components/docs/Licenses.astro b/apps/outreach/src/components/docs/Licenses.astro
index df55510aac..21aea995ac 100644
--- a/apps/outreach/src/components/docs/Licenses.astro
+++ b/apps/outreach/src/components/docs/Licenses.astro
@@ -5,14 +5,14 @@ import type { ApprovedLicense } from '@opendatacapture/licenses';
// Keyed by the ApprovedLicense union rather than written as an array: adding a license to the union
// without listing it here is then a type error, instead of a row that silently goes missing from
// this page. That is how CC-BY-4.0, FREE-NOS and PUBLIC-DOMAIN previously fell out of the list.
-const approved: Record = {
+const approved: { [K in ApprovedLicense]: true } = {
'0BSD': true,
'Apache-2.0': true,
'BSD-1-Clause': true,
'BSD-2-Clause': true,
'BSD-3-Clause': true,
- 'CC-BY-4.0': true,
'CC0-1.0': true,
+ 'CC-BY-4.0': true,
'FREE-NOS': true,
ISC: true,
MIT: true,
@@ -53,21 +53,19 @@ const proprietaryLicenses = Array.from(licenses.entries())
distribution:
Please note that instruments in the public domain instruments are also permitted.
@@ -80,21 +78,19 @@ const proprietaryLicenses = Array.from(licenses.entries())
included directly in the Open Data Capture repository.
@@ -103,21 +99,19 @@ const proprietaryLicenses = Array.from(licenses.entries())
The following licenses are considered open source, but have not been reviewed by our team.