Skip to content

Migrate from ESLint to Oxlint and update build tooling to vite-plus#335

Merged
ElMassimo merged 18 commits into
mainfrom
claude/migrate-to-vite-plus-IOxGj
Mar 27, 2026
Merged

Migrate from ESLint to Oxlint and update build tooling to vite-plus#335
ElMassimo merged 18 commits into
mainfrom
claude/migrate-to-vite-plus-IOxGj

Conversation

@ElMassimo

Copy link
Copy Markdown
Owner

Description 📖

This pull request migrates the project from ESLint to Oxlint for linting and updates the build tooling to use vite-plus instead of vite. It also replaces tsup with vite-plus's pack command for building packages.

Background 📜

The project was using ESLint with @antfu/eslint-config for linting, which required maintaining multiple configuration files and tsup for building packages. Oxlint provides faster linting with a simpler configuration model, and vite-plus offers a more integrated build and development experience.

The Fix 🔨

Linting Changes:

  • Removed eslint.config.mjs and replaced it with .oxlintrc.json containing comprehensive linting rules
  • Added .oxfmtrc.json for code formatting configuration
  • Updated root package.json to use vp lint and vp fmt commands instead of ESLint

Build Tooling Changes:

  • Removed all tsup.config.ts files from packages (iles, hydration, prerender, excerpt, feed, headings, icons, mdx, pages, pwa, images, prism)
  • Updated all package.json files to use vp pack command instead of tsup
  • Changed build output extensions from .js/.d.ts to .mjs/.d.mts for consistency
  • Updated export paths in package.json files to use new extensions
  • Removed CommonJS build support (.cjs files) in favor of ESM-only distribution

Dependency Updates:

  • Updated vite imports to vite-plus throughout the codebase
  • Updated vitest imports to vite-plus/test in test files
  • Added vite.config.ts with vite-plus configuration
  • Updated tsconfig.json to reference vite-plus types instead of vite

Package.json Standardization:

  • Reorganized package.json field ordering for consistency across all packages
  • Updated scripts to use vp commands for build, lint, and format operations

Test Plan

Existing tests pass with the new vite-plus/test imports. The linting configuration has been validated through the comprehensive .oxlintrc.json rules covering correctness, best practices, and code quality standards.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit

claude added 7 commits March 26, 2026 01:05
- Replace vite imports with vite-plus across 20 source files
- Replace vitest imports with vite-plus/test across 12 test files
- Add vite-plus as dependency, remove standalone vite/vitest deps
- Remove Nx task orchestration (nx.json, @nrwl/* deps)
- Remove ESLint and related plugins, migrate to oxlint via @oxlint/migrate
- Create root vite.config.ts for Vite+ configuration
- Create .oxlintrc.json with migrated lint rules
- Update root scripts: lint/fmt/check now use vp commands
- Update per-package lint scripts to use vp lint
- Update iles CLI test command to use vp test
- Fix type-only import in shared.d.ts for oxfmt compatibility
- Apply oxfmt formatting across entire codebase
- Retain tsup for package builds (vp pack incompatible with
  workspace type resolution for DTS generation)

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit
- Replace tsup with `vp pack` for all 12 packages
- Restore nx.json for build orchestration with cloud caching
- Remove CJS builds and exports (ESM-only)
- Update package exports from .js/.d.ts to .mjs/.d.mts
- Remove all tsup.config.ts files (13 files)
- Add tsc --emitDeclarationOnly for DTS generation where rolldown
  DTS plugin cannot handle postcss type syntax
- Update bin/iles.js and config.js to reference .mjs output

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit
Add .oxfmtrc.json with semi: false and reformat all source files.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit
Reverts the semicolon removal and single-quote formatting commits.
The .oxfmtrc.json config is preserved for future application.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit
Restore original formatting for files that only had oxfmt
reformatting (semicolons, quotes, whitespace) without any
migration-related changes. Keeps only files with actual
vite-plus migration work.

https://claude.ai/code/session_01Fsp32NvHiLU7Y141BfEsit
@nx-cloud

nx-cloud Bot commented Mar 26, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e28d77f

Command Status Duration Result
nx run-many --target=build --all --exclude docs... ✅ Succeeded <1s View ↗
nx run-many --target=build --projects @islands/... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-27 14:25:04 UTC

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 26, 2026

Copy link
Copy Markdown

Deploying iles with  Cloudflare Pages  Cloudflare Pages

Latest commit: e28d77f
Status: ✅  Deploy successful!
Preview URL: https://105c80f1.iles.pages.dev
Branch Preview URL: https://claude-migrate-to-vite-plus.iles.pages.dev

View logs

claude and others added 10 commits March 26, 2026 19:27
The vp pack migration bundled framework dependencies (preact, vue, svelte,
solid-js) into the hydration and prerender outputs, causing duplicate
instances at runtime. For preact, this meant hooks state (__H) lived on
the wrong instance, breaking component mounting.

Add peerDependencies so vp pack's DepPlugin externalizes them, and add
per-package vite.config.ts files with deps configuration. Also fix the
headings package build by disabling auto-DTS in vp pack (it uses tsc
separately) and configuring deps.onlyBundle for slugo.

https://claude.ai/code/session_01UKpPTEVDMf22aaUSsUhrfD
…ading

When vite-plugin-solid sets resolve.conditions to ['solid', 'development'],
it replaces Vite's defaults (module, browser). The Svelte plugin then appends
'svelte' but 'browser' is missing, causing Svelte's export map to resolve to
index-server.js instead of the browser bundle. This resulted in mount() being
unavailable at runtime.

Setting conditions explicitly in iles's Vite config defaults ensures browser
is always present regardless of framework plugin ordering.

https://claude.ai/code/session_01YNwMyHwufBk4A4mLukiHom
* fix: prevent client:none islands from hydrating in dev mode

The Island component's `client:none` strategy only skipped hydration
during SSR but not in the browser. In dev mode (SPA), this caused a
script to be generated that imported `mount` from svelte's server entry,
triggering the "mount(...) is not available on the server" error.

Also bumps svelte from ^5.1.13 to ^5.46.4 in hydration and prerender
packages to satisfy @sveltejs/vite-plugin-svelte@7's peer dependency.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

* fix: add default resolve conditions to prevent server-side Svelte resolution

The `vite-plugin-solid` config hook sets `resolve.conditions` to
`['solid', 'development']`, replacing Vite's defaults which include
`browser` and `module`. Without `browser`, Svelte's package exports
resolve to `index-server.js` instead of `index-client.js`, causing
`mount(...)` to throw "not available on the server" in the browser.

Add `['module', 'browser', 'development']` to the base Vite config so
framework plugins append to these defaults rather than replacing them.

https://claude.ai/code/session_01DyKgnqFPLT1z1z4ewaEtMT

* chore: revert changes and update solid plugin instead

---------

Co-authored-by: Claude <noreply@anthropic.com>
…and add `pnpm pkg-size` utility (#338)

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>
… emission from `tsc` to tsdown `dts` with default `.d.mts` outputs (#339)

* Initial plan

* refactor: migrate package type generation from tsc to tsdown dts

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/fa271805-854d-48e3-92f6-dc936a87f21c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* refactor: use default d.mts type outputs and export type entries

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/09a276ea-1d81-4b51-8159-b5da49e6a427

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: remove unnecessary typescript devDependencies

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7bdca0c4-6073-4609-a3fe-266b33931b5a

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* refactor: use tsdown dts for iles build:node

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/7b458719-9ff3-40f8-87ff-ff350f0729f2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* Fix CI lint config loading by switching package Vite configs to ESM `.mjs` (#340)

* Initial plan

* chore: enable type-aware linting in tsdown configs

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/8d2d6c99-a9d1-4c3a-aadf-fe6c70c7d37c

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: add root lint script using nx run-many

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/e4ed89d0-8715-4493-8e4d-e08a6123d9a2

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

* chore: fix lint issue

* fix: remove tsdown.config.ts, use `vite.config.ts` instead

`typeAware` and `typeCheck` should be in `lint.options`, not `lint`.

* fix: linting, avoid using tsdown.config.ts, use vite.config.ts instead

* chore: remove unused vite config

* fix: load package lint configs as mjs in CI

Agent-Logs-Url: https://github.com/ElMassimo/iles/sessions/031c0250-2bd3-434c-a3ae-9a8c59646e62

Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ElMassimo <1158253+ElMassimo@users.noreply.github.com>
Co-authored-by: Maximo Mussini <maximomussini@gmail.com>
@ElMassimo
ElMassimo merged commit af23945 into main Mar 27, 2026
11 checks passed
@ElMassimo
ElMassimo deleted the claude/migrate-to-vite-plus-IOxGj branch March 27, 2026 14:27
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.

3 participants