Skip to content

Add oxlint config and custom expect-expect JS plugin for bun:test #353

@rhuanbarreto

Description

@rhuanbarreto

Problem

Tests with no expect() calls silently pass, giving false confidence. The standard jest/expect-expect rule exists in oxlint but its Rust implementation only recognizes jest and vitest imports — it silently ignores bun:test.

We also have no .oxlintrc.json config file — the lint script runs bare oxlint --deny-warnings . with implicit defaults.

Proposal

  1. Add .oxlintrc.json — explicit config instead of relying on defaults
  2. Write a custom JS plugin (lint/expect-expect.ts) using oxlint's JS plugins API that implements expect-expect for bun:test
  3. Register it via jsPlugins in .oxlintrc.json

The rule should flag any test() or test.skipIf(...)() call whose body contains no expect() call.

Context

Discovered during test cleanup in #352 — several tests were passing with zero assertions (early return instead of test.skipIf, empty callback bodies, tautological assertions). The lack of a lint rule meant these accumulated silently over time.

oxlint JS plugins support TypeScript natively in Bun, so the plugin can be a .ts file with no build step.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions