What is landmines?
landmines is a set of plugins for the Oxlint JavaScript and TypeScript linter, published on npm as @interfere/landmines by Interfere, Inc. under the MIT license. The README summarizes its purpose as rules that keep AI-written code honest. It lists shortcuts coding agents take to get green checks, such as mocking the code under test, sleeping until a race usually passes, retrying flaky tests, raising timeouts and narrating the diff in comments, and adds rules that fail on these patterns. Each rule message says what to do instead, so that an agent or a person can fix the finding in the same loop. According to the README, the rules were built and are used in production at Interfere, a company that offers production visibility and bug detection for software teams.
The package contains ten rules in four Oxlint JS plugins, each exported as its own entry point: landmines-testing (five rules for test code), landmines-style (one rule against prose comments), landmines-structure (three rules for test placement, file names and package exports) and landmines-types (one rule against explicit return types). A recommended configuration registers all four plugins and sets every rule to error. The rules are written in TypeScript against @oxlint/plugins and use zod to validate rule options. The repository's own tests run on Vitest, and each rule has a test file next to it.
landmines requires Oxlint 1.81 or later, declared as a peer dependency, and Node.js 22.18 or later. The README installs it with Bun as a development dependency together with Oxlint and configures it in .oxlintrc.json, either by extending the recommended configuration from node_modules or by listing selected plugins under jsPlugins and enabling individual rules. Packages are published to npm with provenance from the repository's release workflow, and versions are managed with Changesets.
The first functional version, 0.1.0, was released on November 17, 2026 as the initial release of the testing, style, structure and types plugins. The current version, 0.1.1 of November 18, 2026, is a patch release. According to the changelog, it adds an allow option to no-comments, extends no-fixed-sleep to timer callbacks with block bodies and to callbacks that run while a test waits (configurable with runNow), makes no-flake-masking report testTimeout and hookTimeout in a Vitest config file, reports no-unsignaled-poll on expect.poll chains that end in a spy matcher, and lets strict-msw accept msw 3's onUnhandledFrame option.
The testing rules target Vitest-style APIs such as vi.fn, vi.waitFor, vi.setConfig, vi.useFakeTimers and expect.poll, and Mock Service Worker (MSW) versions 2 and 3 for network mocking. The documentation covers Oxlint only. For type-level problems such as chained assertions and unsafe dictionaries, the README points to the separate anti-slop project. Related listings on iThub include React Doctor, which produces deterministic diagnostics for React projects, and antislop, agent skills that filter generic AI-generated interfaces, copy and code comments.
Key capabilities
- npm package The package is
@interfere/landmineson npm, installed withbun add -d oxlint @interfere/landminesas shown in the README. It ships compiled ES modules indistand theconfigsfolder, with exports for./testing,./style,./structure,./typesand./configs/recommended.json. - Recommended configuration Adding
"extends": ["./node_modules/@interfere/landmines/configs/recommended.json"]to.oxlintrc.jsonloads all four plugins and turns on all ten rules at error level. The recommended.json file in the repository lists the exact rule set. - Selective registration Projects can instead register only some plugins in the
jsPluginsarray, each with a name and a specifier such as@interfere/landmines/testing, and enable chosen rules underrules, for example"landmines-testing/no-test-doubles": "error". - no-test-doubles Reports replacing dependency behaviour in tests: module mocks,
vi.fnwith an implementation, stubbed globals, patched prototypes, hand-written bindings and fake responses. The README asks for the real implementation and MSW for network calls. Spies that only observe calls are allowed. - strict-msw Reports MSW servers or workers started without strict handling of unmatched traffic:
onUnhandledRequest: "error"for msw 2 oronUnhandledFrame: "error"for msw 3. Without that setting, requests that no handler covers can reach the real network. - no-fixed-sleep Reports awaited fixed delays inside
test,itand the four lifecycle hooks: anew Promiseresolved throughsetTimeout,setTimeoutimported fromnode:timers/promises,scheduler.waitandBun.sleep. Files that callvi.useFakeTimers()are not reported. The message asks to await the operation or a promise its handler resolves, or to use fake timers to move time. - Sleeps in callbacks that run immediately Since 0.1.1,
no-fixed-sleepalso checks callbacks that run while the test waits, by default those passed toact,waitFor,then,catch,finallyandstep. TherunNowoption replaces that list, for example to addwithin. Callbacks handed to other calls, such aspage.routehandlers, are not checked. - no-unsignaled-poll Reports
expect.pollandvi.waitForused on request recorders and spy state, which race a deadline instead of awaiting an event. Since 0.1.1 this includesexpect.pollchains ending in a spy matcher such astoHaveBeenCalledTimes. - no-flake-masking Reports test retries and raised timeouts: a
retryoption or atimeoutin the options oftest,it,describeorsuite, a numeric timeout passed as the third argument,testTimeoutorhookTimeoutpassed tovi.setConfig, and the same keys in thetestblock of a Vitest config. The rule's description is to fix flaky tests at their cause. - Allowlists that only shrink
no-fixed-sleep,strict-mswandno-flake-maskingaccept anallowmap from file path to an exact count, for adopting the rules in an existing codebase. When a file has fewer violations than its allowance, the rule reports that the entry must be lowered, so the list can only shrink. Inno-flake-maskingthe allowance covers timeouts; retry settings are always reported. - no-comments The
landmines-styleplugin reports prose comments, on the basis that rationale belongs in the pull request. Functional directives such asoxlint-disable,@ts-expect-errorand/* @__PURE__ */, license headers, single-line// WARNING:comments and TSDoc on exported public API are allowed. - no-comments options
publicApitakes regular expressions matched against file paths, so TSDoc is allowed only in published packages.allow, added in 0.1.1, sets the kept single-line prefixes; it defaults toWARNING, and addingSAFETYkeeps the comments that anti-slop's type assertion rule requires. - colocated-tests Part of
landmines-structure, this rule reports tests that are detached from the implementation they import. Tests are expected beside their subject or in its localtests/directory. - test-file-names Reports file names such as
.spec.ts,.tests.ts,helpers.tsandmocks.ts. The expected suffixes are.test.ts,.fixture.tsand.test-utils.ts. - package-exports Reports unrestricted source exports in
package.json, such as"./*": "./src/*.ts". Packages are expected to declare explicit entry points or named public namespaces. - no-explicit-return-types The
landmines-typesplugin reports annotated return types on function implementations. The README suggests letting TypeScript infer them and usingsatisfieswhere a contract needs to be pinned. - Requirements Oxlint 1.81 or later and Node.js 22.18 or later. The package itself depends on
@oxlint/plugins1.81.0, the Babel parser and types,oxc-resolverand zod. - Development and releases Contributors run
bun install, thenbun run lint,bun run typecheckandbun run test, and add a changeset for user-facing changes. Releases appear on GitHub with tags such as@interfere/landmines@0.1.1and on npm with provenance.
Where landmines fits
Removing fixed delays from a test suite
With no-fixed-sleep enabled, an awaited new Promise(r => setTimeout(r, 100)) or Bun.sleep inside a test or hook becomes a lint error whose message points to awaiting the operation itself or using vi.useFakeTimers(). Sleeps hidden in act or then callbacks are covered too, and the runNow list can be extended for project-specific helpers.
Keeping flaky tests visible
no-flake-masking blocks per-test retry options and raised timeouts in test calls, vi.setConfig and the Vitest config. The project's position, stated in the rule messages, is that a test that passes on rerun is a flake to fix by waiting on the event it depends on, with slow shared setup moved into a beforeAll hook.
Adopting the rules in an existing codebase
For legacy files, the allowlist option records the current number of violations per file, for example two timeout bumps in one test file. New violations fail immediately, and when a file is cleaned up the rule asks for its allowance to be lowered, so the backlog only decreases.
Testing against real implementations
Combining no-test-doubles and strict-msw leaves observation-only spies and MSW handlers as the remaining tools: module mocks and stubbed implementations are reported, and MSW must error on unhandled requests so nothing falls through to the real network.
Guardrails for coding agents
Because each rule message describes the expected fix, the rules fit into the loop of an AI coding agent that runs the linter after each change. The README frames this as making the honest path the only one that lints, so shortcuts such as sleeps, retries and narrating comments are caught before review.
Enforcing test layout and package boundaries
The structure rules keep tests next to the code they import, standardize test file suffixes and require explicit exports entries in package.json. Like no-explicit-return-types, these are layout and style conventions rather than test-reliability checks, and each rule can be enabled on its own.
Install
bun add -d oxlint @interfere/landminesReviews of landmines
Be the first to share your experience with landmines.
Write a review
Loading review form…
Found landmines useful? Upvote it todayYour vote helps other IT teams find it in the daily ranking.


