Skip to content

chore: migrate toolchain to Vite+ - #384

Merged
xobotyi merged 3 commits into
masterfrom
chore/vite-plus-toolchain
Jul 26, 2026
Merged

chore: migrate toolchain to Vite+#384
xobotyi merged 3 commits into
masterfrom
chore/vite-plus-toolchain

Conversation

@xobotyi

@xobotyi xobotyi commented Jul 26, 2026

Copy link
Copy Markdown
Member

Swaps the eslint 10 + prettier + vitest setup for Vite+, matching react-hookz/web. Yarn stays the package manager -- vp detects it from yarn.lock/.yarnrc.yml.

Toolchain

before after
eslint + @ver0/eslint-config + 10 plugin packages + typescript-eslint oxlint + oxlint-tsgolint + @ver0/oxlint-config
prettier (via @ver0/eslint-config/.prettierrc.js) oxfmt
vitest directly vitest through vp test
eslint.config.js, .prettierrc.js, vitest.config.ts vite.config.ts

16 dev dependencies out, 4 in. yarn.lock loses ~3.5k lines.

New scripts: fmt, fmt:check. lint/test/benchmark now go through vp. CI gains a format-check step and drops the ESLint-only -f @ver0/gha formatter.

Lint config

Presets: javascript, typescript + typescriptUnsafe, node, vitest. The unsafe preset keeps the no-unsafe-* family off exactly as the eslint config did -- the comparator is any-typed by contract. Type-aware linting is on (options.typeCheck).

Two repo-level overrides, both documented inline: prefer-readonly-parameter-types off (the comparator takes arbitrary, usually mutable values) and no-underscore-dangle allowing __v in tests (Preact vnode back-reference in the circular-reference regression test).

Code changes

All behavior-preserving, driven by strict-boolean-expressions:

  • falsy-object guards became explicit === null checks -- after typeof x === 'object', null is the only falsy value left
  • Set/Map branches narrow b through a local typed alias instead of calling .has() on any
  • the visited-pair check is visited?.get(a) === b instead of has() + get() -- b is a non-null object there, so a miss can never match; one lookup instead of two

Note

Markdown linting goes away with @eslint/markdown -- oxlint does not lint markdown. oxfmt still formats it.

yarn's 4.17 migration wanted to write npmMinimalAgeGate: 0, approvedGitRepositories: ['**'] and enableScripts: true into .yarnrc.yml; those were reverted, so the hardened defaults stay. Only npmPreapprovedPackages: ['@ver0/*'] was added, so fresh own-org releases skip the age gate.

Stacked on #383.

xobotyi added 3 commits July 26, 2026 10:23
Enables the shared foundry plugin set and carries the JS/TS convention
rules used across ver0 projects, so agent-side conventions match the
linter and formatter instead of drifting from them.

settings.local.json stays untracked: it holds machine-local permission
and environment overrides.
Replaces the eslint 10 stack (eslint, @ver0/eslint-config,
@ver0/eslint-formatter-gha, typescript-eslint, bundled prettier) with
vite-plus: oxlint via @ver0/oxlint-config presets, oxfmt for
formatting, vitest through vp. Lint, fmt and test settings live in
vite.config.ts; eslint.config.js, .prettierrc.js and vitest.config.ts
are gone. oxfmt options mirror the previous prettier config.

Presets: javascript, typescript + typescriptUnsafe, node, vitest. The
unsafe preset keeps the no-unsafe-* family off, same as the eslint
setup did -- the comparator is any-typed by contract.

Repo-level rule policy (last extends entry, so it applies after the
presets):

- prefer-readonly-parameter-types off: the comparator takes arbitrary
  values, most often the mutable containers it is used on.
- no-underscore-dangle allows __v in tests: Preact's vnode
  back-reference, reproduced verbatim by the circular-reference
  regression test.

Code fallout, behavior preserving:

- strict-boolean-expressions: falsy-object checks became explicit
  null checks; Set and Map branches narrow b through a local alias
  instead of relying on any.
- the visited-pair check reads visited?.get(a) === b instead of
  has() + get(); b is a non-null object there, so a miss can never
  match, and it costs one lookup instead of two.

Markdown linting drops out with @eslint/markdown -- oxlint does not
lint markdown; oxfmt formats it.

.yarnrc.yml preapproves @ver0/* for the minimal release age gate,
otherwise fresh releases of own-org configs get quarantined.
Prose rewrapped at 120 columns and quote style normalized in the
Dependabot YAML. No content changes.
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