Skip to content

Modernize tooling: upgrade deps, switch to vitest and biome#32

Merged
linusnorton merged 1 commit into
masterfrom
chore/deps-vitest-biome
Apr 23, 2026
Merged

Modernize tooling: upgrade deps, switch to vitest and biome#32
linusnorton merged 1 commit into
masterfrom
chore/deps-vitest-biome

Conversation

@linusnorton

Copy link
Copy Markdown
Contributor

Summary

Maintenance PR that does three things:

1. Dependency upgrades & docs

2. Tests: mocha + chai → vitest

  • Remove mocha, chai, @types/mocha, @types/chai.
  • Add vitest. Rewrite 9 .spec.ts files: chai.expect(x).to.equal(y)expect(x).toBe(y), .to.deep.equal.toEqual, add import { describe, it, expect } from "vitest".
  • Scripts: testvitest run, watch-testvitest, gtestvitest run -t.

3. Lint: eslint → biome

  • Remove eslint, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, .eslintrc.json.
  • Add @biomejs/biome and biome.json (linter only; formatter disabled so we don't churn project whitespace). Disable a few rules that conflicted with intentional style (noNonNullAssertion, noStaticOnlyClass, noPrototypeBuiltins).
  • Apply safe biome autofixes across the codebase: useImportType, useNodejsImportProtocol, useTemplate, Object.hasOwn instead of Object.prototype.hasOwnProperty.call, etc.
  • tsconfig.json: add skipLibCheck: true (needed for vitest/vite type chain).

Verification

  • npm test (lint + vitest) passes — 48 tests, 9 files
  • npx tsc --noEmit clean
  • Smoke test: loadGTFS against the Google sample GTFS feed loads successfully (11 trips, 9 stops, end fires — confirming loadGTFS doesn't work. #17 is resolved)
  • npm audit: 12 → 0 vulnerabilities
  • CI green on Node 20/22/24 (matrix already updated in 3776630)

Closes / supersedes

- Bump gtfs-stream 2.2→3.0 (fixes silent-failure #17 and protobufjs
  critical vuln), update import style to named { plain } export
- Patch/minor bumps: mysql2, @types/chai, @typescript-eslint/*, ts-node
- npm audit fix resolves transitive minimatch/flatted/picomatch/ajv/glob
  vulns (supersedes dependabot PRs #27, #28, #29, #30)
- Fix README examples per #19: remove bogus calendars destructure and
  stray 4th arg to RaptorAlgorithmFactory.create; bump Node requirement
  to 20+ (chai 6 is ESM-only, Node 16/18 EOL)
- Migrate tests from mocha+chai to vitest; rewrite 9 spec files
- Replace eslint with @biomejs/biome; apply safe lint autofixes
  (useImportType, useNodejsImportProtocol, useTemplate, Object.hasOwn)
- tsconfig: add skipLibCheck for vitest/vite type resolution
@linusnorton linusnorton merged commit 346b932 into master Apr 23, 2026
3 checks passed
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.

Readme example doesn't work, argument mismatch? loadGTFS doesn't work.

1 participant