Update ESLint 10, replace trace-mapping auto-detection with DI #65

Merged
mburchard merged 2 commits from chore/update-eslint-10 into main 2026-02-25 19:56:33 +00:00
Owner

Summary

  • Upgrade ESLint to v10 and update related dependencies
  • Replace the auto-detected dynamic import() of @jridgewell/trace-mapping with an explicit configureSourceMapResolver(TraceMap, originalPositionFor) API, so bundlers no longer pull trace-mapping into production bundles when source map resolution is not needed

Test plan

  • pnpm lint passes
  • pnpm typecheck passes
  • 258 tests green
  • 100% line/branch coverage
  • pnpm build succeeds
  • Compile-time type compatibility check with real @jridgewell/trace-mapping exports
## Summary - Upgrade ESLint to v10 and update related dependencies - Replace the auto-detected dynamic `import()` of `@jridgewell/trace-mapping` with an explicit `configureSourceMapResolver(TraceMap, originalPositionFor)` API, so bundlers no longer pull trace-mapping into production bundles when source map resolution is not needed ## Test plan - [x] `pnpm lint` passes - [x] `pnpm typecheck` passes - [x] 258 tests green - [x] 100% line/branch coverage - [x] `pnpm build` succeeds - [x] Compile-time type compatibility check with real `@jridgewell/trace-mapping` exports
- Upgrade eslint 9.39.3 → 10.0.2 (major)
- Upgrade @antfu/eslint-config 7.5.0 → 7.6.1
- Update transitive dependencies in lockfile
- Exclude undici-types@6.21.0 from trust policy
  (published without provenance, tracking nodejs/undici#4666)
- Auto-fix brace-style in README code example
feat: replace auto-detection with explicit configureSourceMapResolver()
All checks were successful
Run Tests / test (pull_request) Successful in 1m8s
Run Tests / test (push) Successful in 1m7s
Publish Package to npmjs / build (release) Successful in 52s
2c810116be
Source map resolution is no longer auto-detected via dynamic import.
Consumers must now explicitly configure the resolver:

  import {originalPositionFor, TraceMap} from '@jridgewell/trace-mapping';
  import {configureSourceMapResolver} from '@mburchard/bit-log';
  configureSourceMapResolver(TraceMap, originalPositionFor);

This prevents bundlers (Vite, Rollup, Webpack) from pulling
@jridgewell/trace-mapping into the production bundle when source map
resolution is not needed.

- Remove enableSourceMapResolution(), initResolver(), flushInitQueue()
  and all associated module-level state (InitState, initState, initQueue)
- Add configureSourceMapResolver() with generic signature for type-safe
  usage with @jridgewell/trace-mapping
- Add resetSourceMapResolver() (@internal, for test isolation)
- Simplify resolveEventSourceMap() to synchronous resolver check
- Remove enableSourceMapResolution() call from Logger.includeCallSite setter
- Re-export configureSourceMapResolver from index.ts as public API
- Rewrite public API tests to use DI approach instead of vi.resetModules()
- Add compile-time type compatibility check with real trace-mapping exports
- Update README with explicit setup instructions
- Bump version to 1.2.1
mburchard deleted branch chore/update-eslint-10 2026-02-25 19:56:33 +00:00
Sign in to join this conversation.
No description provided.