CI Perf Lint

consider-msw-3-upgrade

MSW version evidence uses the root lockfile dependency where available, and ignores unrelated aliases and unresolved package protocols.

Suggests reviewing an MSW 2.x to 3.0 upgrade for repositories still on MSW 2.x.

What it detects

Why it matters

MSW 3.0 is a performance-leaning major:

Smaller type definitions and dependency graph in particular help TypeScript-heavy CI and installs.

Migration effort

MSW 3.0 is a breaking major. The heavy parts are:

The lighter, mechanical parts have official codemods (app.codemod.com/registry/@mswjs/v3):

Suggested action

Plan the upgrade in a branch, run the codemods, migrate GraphQL handlers to link-first, and confirm the runner is Node.js >=22.12.0 with TypeScript 5.9+. Import utilities from their individual entrypoints, such as msw/utils/delay, msw/utils/bypass, or msw/utils/passthrough; a utility barrel is not exported. Do the upgrade for the footprint and lookup improvements, not as a blind performance fix.

The release contract is recorded in MSW v3.0.0 package.json; use its exports and engines when updating migration advice.

Measurement

Compare test wall-clock time for handler-heavy suites, install size, and TypeScript type-check time before and after.

Notes

The runtime lookup cost scales with the number of configured handlers, so reducing or scoping handlers matters more than the version alone; v3 makes that lookup roughly constant-time.