Files
Maurice 0344a86aec style(client): format the ratchet scripts with Prettier
The checker scripts were written without semicolons, against the
semi: true in .prettierrc, so every one of them failed the formatting
rule lint:format enforces on src/ and tests/. This is prettier --write
over the scripts this branch added or rewrote, nothing else.
2026-10-08 13:04:40 +02:00

26 lines
1.2 KiB
JavaScript

#!/usr/bin/env node
/*
* lint:offline: views go through the offline core, not around it.
*
* The data path is component, feature hook, store, repo, then api or Dexie,
* and writes go through the mutation queue. A view that imports src/api/
* skips the cache, the optimistic write and the idempotent replay, so the
* feature breaks offline. Such files kept growing, by about fifteen a month.
* The view files (components/, mobile/, pages/, hooks/) that already import
* src/api/ for more than types are listed in scripts/offline-baseline.json;
* no other view file may, and the list only shrinks.
*
* npm run lint:offline check against the baseline (CI)
* npm run lint:offline -- --list print every view file that imports src/api/
* npm run lint:offline -- --update take the files that stopped off the list;
* it never adds one
*/
import { fileURLToPath } from 'node:url';
import { check } from './lib/offline.mjs';
import { runCli } from './lib/ratchet.mjs';
const root = fileURLToPath(new URL('..', import.meta.url));
await runCli('lint:offline', (args) =>
check({ root, update: args.includes('--update'), list: args.includes('--list') })
);