Skip to content

Conversation

@smorimoto
Copy link

@smorimoto smorimoto commented Nov 21, 2025

  • Migrated ESLint and Prettier to Biome
  • Migrated Jest to Vitest
  • Migrated the TypeScript compiler to tsdown
  • Updated GitHub Actions
  • Fixed Biome errors

@greptile-apps
Copy link

greptile-apps bot commented Nov 21, 2025

Greptile Overview

Greptile Summary

This PR comprehensively modernizes the repository's tooling by consolidating ESLint, Prettier, and Jest into Biome and Vitest, while migrating the build system to tsdown for dual ESM/CJS output.

Key Changes

  • Linting & Formatting: Replaced ESLint + Prettier with Biome, which provides unified tooling with faster performance
  • Testing: Migrated from Jest to Vitest with improved coverage configuration (80% thresholds) and proper environment separation (jsdom for tsx, node for ts)
  • Build System: Switched from vanilla TypeScript compiler to tsdown, enabling dual ESM/CJS builds with proper exports configuration
  • Type Safety: Updated to strictest TypeScript configuration extending @tsconfig/strictest and @tsconfig/node24
  • Dependencies: Updated all major dependencies including @workos-inc/node, iron-session, and jose

Code Quality Improvements

Biome automatically fixed several code quality issues:

  • Replaced isNaN() with Number.isNaN() for better type safety
  • Fixed import ordering for consistency
  • Removed unused catch bindings
  • Improved null/undefined checks
  • Added explicit type annotations where missing

Testing & Build

  • All test files successfully migrated from Jest to Vitest APIs
  • Coverage thresholds maintained at 80% across all metrics
  • Build system now produces both ESM (dist/index.mjs) and CJS (dist/index.cjs) outputs with proper package.json exports field

No security issues, custom rule violations, or breaking changes detected.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a well-executed tooling migration with no breaking changes
  • Score reflects comprehensive modernization with proper test coverage, no security violations, automated code quality fixes, and maintained backward compatibility through dual ESM/CJS builds. All changes are tooling-related with consistent patterns across migrations.
  • No files require special attention - all changes are consistent and follow standard migration patterns

Important Files Changed

File Analysis

Filename Score Overview
package.json 5/5 Migrated from ESLint/Prettier/Jest to Biome/Vitest, updated to tsdown for builds, switched to dual ESM/CJS exports, updated dependencies
biome.json 5/5 Added Biome configuration with VCS integration, linting rules, formatting preferences, and import extension enforcement
vitest.config.ts 5/5 Configured Vitest with coverage thresholds (80%), separate jsdom and node projects for tsx and ts tests
tsdown.config.ts 5/5 Created tsdown config for dual ESM/CJS bundling with source maps and TypeScript declarations
tsconfig.json 5/5 Modernized TypeScript config extending strictest/node24 presets, switched to NodeNext module resolution
src/auth.ts 5/5 Fixed import ordering, converted ESLint to Biome ignore comments, fixed string concatenation formatting
src/session.ts 5/5 Fixed import ordering, added type annotations, replaced isNaN with Number.isNaN, improved arrow function formatting, removed unused catch bindings
src/config.ts 5/5 Replaced isNaN with Number.isNaN, fixed null/undefined checks, added Biome ignore comments, removed unnecessary variable initialization

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Repo as Repository
    participant ESLint as ESLint/Prettier/Jest
    participant Biome as Biome
    participant Vitest as Vitest
    participant tsdown as tsdown
    participant Deps as Dependencies

    Dev->>Repo: Initiate tooling migration
    
    Note over Repo,ESLint: Remove old tooling
    Repo->>ESLint: Delete .eslintrc.cjs, .prettierrc
    Repo->>ESLint: Delete jest.config.ts
    Repo->>Repo: Remove ESLint/Prettier/Jest from package.json
    
    Note over Repo,Biome: Add Biome
    Dev->>Repo: Create biome.json configuration
    Repo->>Biome: Configure linting & formatting rules
    Biome->>Repo: Enforce import extensions, quotes, trailing commas
    
    Note over Repo,Vitest: Add Vitest
    Dev->>Repo: Create vitest.config.ts
    Repo->>Vitest: Configure test environments (jsdom/node)
    Repo->>Vitest: Set coverage thresholds (80%)
    Dev->>Repo: Update test files (jest → vi)
    
    Note over Repo,tsdown: Add tsdown
    Dev->>Repo: Create tsdown.config.ts
    Repo->>tsdown: Configure dual ESM/CJS build
    tsdown->>Repo: Generate dist/index.mjs & dist/index.cjs
    
    Note over Repo,Deps: Update dependencies
    Dev->>Deps: Update @workos-inc/node, iron-session, jose
    Dev->>Deps: Update TypeScript, Remix, testing libraries
    Repo->>Repo: Update tsconfig.json to strictest/node24
    
    Note over Repo: Apply Biome fixes
    Biome->>Repo: Fix import ordering
    Biome->>Repo: Replace isNaN with Number.isNaN
    Biome->>Repo: Fix string concatenation
    Biome->>Repo: Remove unused catch bindings
    Biome->>Repo: Add type annotations
    
    Repo->>Dev: Migration complete
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

26 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Signed-off-by: Sora Morimoto <sora@morimoto.io>
@smorimoto smorimoto force-pushed the repository-maintenance branch from 33e1331 to 0c8a706 Compare November 21, 2025 15:54
@smorimoto
Copy link
Author

@nicknisi Once this is merged, I’m planning to work on fixing #3.

@smorimoto
Copy link
Author

Gentle ping

@nicknisi
Copy link
Member

nicknisi commented Dec 2, 2025

Hey thanks for this! A couple of notes:

  • We're actively switching from jest to vitest in other repos as it's a better experience and better story around ESM. Thanks for this!
  • Regarding ESLint/Prettier -> Biome - we're less confident in this change. For such tiny project there's really no performance issues with the current tooling. We're exploring options around this but would want to move all projects if we decide to, and we're still considering other options such as Oxc.
  • tsdown is awesome! We've been moving away from tsc for builds in other projects to tsup but am definitely not opposed to it.

Given this, we'd definitely like to accept this but would like to hold off on the Biome change for now. I'd be happy to help split that out and get this merged. What do you think?

Another note: given the trajectory for Remix, this project will likely be reworked to support the new Remix when that's ready. For the current architecture we have authkit-react-router which is effectively a fork of this project. We'd want to keep parity over there with the changes we make here, which I'm more than happy to do! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants