[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116108":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":31,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":35,"discoverSource":36},116108,"landmines","interfere-inc\u002Flandmines","interfere-inc","Oxlint rules that keep AI-written code honest: real implementations, real signals, no flake masking.","https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@interfere\u002Flandmines",null,"TypeScript",774,11,273,2,0,18,241,67,97.24,"MIT License",false,"main",[25,26,27,28,29,30],"agents","ai","lint","oxlint","oxlint-plugin","testing","2026-11-23 19:30:11","2026-11-23 20:28:08","# landmines\n\nOxlint rules that keep AI-written code honest.\n\nCoding agents are fast, and they optimise for green checks. Left alone, they\nmock the thing under test, sleep until a race usually goes their way, retry\nthe flake, raise the timeout, and narrate the diff in comments. Every one of\nthose passes CI. None of them is true.\n\n`landmines` makes the honest path the only one that lints. Each rule fails\nwith a message that tells the agent (or the human) what to do instead, so the\nfix lands in the same loop that tripped it.\n\nBuilt and used in production at [Interfere](https:\u002F\u002Finterfere.com).\n\n## Install\n\n```sh\nbun add -d oxlint @interfere\u002Flandmines\n```\n\nExtend the recommended configuration in `.oxlintrc.json`:\n\n```json\n{\n  \"extends\": [\".\u002Fnode_modules\u002F@interfere\u002Flandmines\u002Fconfigs\u002Frecommended.json\"]\n}\n```\n\nOr register only the plugins you want:\n\n```json\n{\n  \"jsPlugins\": [\n    { \"name\": \"landmines-testing\", \"specifier\": \"@interfere\u002Flandmines\u002Ftesting\" }\n  ],\n  \"rules\": {\n    \"landmines-testing\u002Fno-test-doubles\": \"error\"\n  }\n}\n```\n\nRequires Oxlint 1.81 or later and Node 22.18 or later.\n\n## Rules\n\n### `landmines-testing`\n\nTests that can't lie.\n\n| Rule                 | What it stops                                                                                                                                                                                                                                 |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `no-test-doubles`    | Replacing dependency behaviour in tests: module mocks, `vi.fn(impl)`, stubbed globals, patched prototypes, hand-written bindings and fake responses. Use the real implementation and MSW for the network. Observation-only spies are allowed. |\n| `strict-msw`         | Starting MSW without `onUnhandledFrame: \"error\"` (msw 3) or `onUnhandledRequest: \"error\"` (msw 2), so unmocked requests reach the network.                                                                                                    |\n| `no-fixed-sleep`     | Awaiting a fixed real-time delay in a test or hook. Await the operation or a signal it emits.                                                                                                                                                 |\n| `no-unsignaled-poll` | `expect.poll` and `vi.waitFor` on request recorders and spy state, which race a deadline instead of awaiting an event.                                                                                                                        |\n| `no-flake-masking`   | Test retries and raised timeouts, per test or in Vitest config. A test that passes on rerun is a flake to fix.                                                                                                                                |\n\n`no-fixed-sleep`, `strict-msw` and `no-flake-masking` accept a per-file\nallowlist with an exact count, so you can adopt them in an existing codebase\nand ratchet down:\n\n```json\n{\n  \"landmines-testing\u002Fno-flake-masking\": [\n    \"error\",\n    { \"allow\": { \"src\u002Flegacy\u002Fslow.test.ts\": 2 } }\n  ]\n}\n```\n\nThe rule reports when a file has fewer violations than its allowance, so the\nlist only shrinks.\n\n`no-fixed-sleep` also reports sleeps in callbacks that run while the test\nwaits, such as `act(async () => …)` or `.then(async () => …)`. Callbacks passed\nto other calls, like `page.route` handlers, are left alone. Pass `runNow` to\nreplace the default callee names (`act`, `waitFor`, `then`, `catch`, `finally`,\n`step`), matched against a call's function or method name:\n\n```json\n{\n  \"landmines-testing\u002Fno-fixed-sleep\": [\n    \"error\",\n    {\n      \"runNow\": [\"act\", \"waitFor\", \"then\", \"catch\", \"finally\", \"step\", \"within\"]\n    }\n  ]\n}\n```\n\n### `landmines-style`\n\n| Rule          | What it stops                                                                                                                                                                                                                                                                               |\n| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `no-comments` | Prose comments. Allowed: functional directives (`oxlint-disable`, `@ts-expect-error`, `\u002F* @__PURE__ *\u002F`, licence headers…), single-line `\u002F\u002F WARNING:` comments for dangerous recurring footguns (configurable with `allow`), and TSDoc on exported public API. Rationale belongs in the PR. |\n\nPass `publicApi` (regular expressions matched against the file path) to allow\nTSDoc only in your published packages:\n\n```json\n{\n  \"landmines-style\u002Fno-comments\": [\"error\", { \"publicApi\": [\"\u002Fpackages\u002Fsdk\u002F\"] }]\n}\n```\n\nPass `allow` to choose which single-line comment prefixes are kept. It defaults\nto `[\"WARNING\"]`; add `\"SAFETY\"` to keep the `\u002F\u002F SAFETY:` comments that\n[anti-slop](https:\u002F\u002Fgithub.com\u002Fdmmulroy\u002Fanti-slop)'s\n`require-safety-comment-for-type-assertion` requires:\n\n```json\n{\n  \"landmines-style\u002Fno-comments\": [\"error\", { \"allow\": [\"WARNING\", \"SAFETY\"] }]\n}\n```\n\n### `landmines-structure`\n\n| Rule              | What it stops                                                                                                                         |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------- |\n| `colocated-tests` | Tests detached from the implementation they import. Tests live beside their subject or in its local `tests\u002F` directory.               |\n| `test-file-names` | `.spec.ts`, `.tests.ts`, `helpers.ts`, `mocks.ts` and friends. Use `.test.ts`, `.fixture.ts` and `.test-utils.ts`.                    |\n| `package-exports` | Unrestricted source exports such as `\".\u002F*\": \".\u002Fsrc\u002F*.ts\"`. Declare explicit entrypoints or named public namespaces in `package.json`. |\n\n### `landmines-types`\n\n| Rule                       | What it stops                                                                                                      |\n| -------------------------- | ------------------------------------------------------------------------------------------------------------------ |\n| `no-explicit-return-types` | Annotated return types on implementations. Let them be inferred; pin a contract with `satisfies` where it matters. |\n\n## Pairs well with\n\n- [anti-slop](https:\u002F\u002Fgithub.com\u002Fdmmulroy\u002Fanti-slop) for type-level slop:\n  chained assertions, unsafe dictionaries, `unknown` plumbing.\n\n## Contributing\n\n```sh\nbun install\nbun run lint && bun run typecheck && bun run test\n```\n\nAdd a changeset with `bun changeset` for any user-facing change.\n\n## License\n\nMIT\n","landmines 是一个面向 AI 编程场景的 Oxlint 插件，提供一系列静态检查规则，强制测试代码采用真实实现、明确信号和可观测行为，禁止掩盖不稳定性（如 mock 依赖、固定 sleep、未处理网络请求、重试掩蔽等）。它基于 TypeScript 实现，深度集成 Oxlint，每条规则失败时附带可操作修复指引，支持与 MSW、Vitest 等工具协同工作。适用于 AI 编程代理（如 coding agents）生成测试代码的质量管控，以及强调确定性、可维护性的前端\u002F全栈测试工程实践。","2026-11-24 04:52:49","CREATED_QUERY"]