@bensandee/eslint-plugin
Oxlint plugin with custom TypeScript lint rules for type safety, error handling, and code patterns.
Installation
pnpm add -D @bensandee/eslint-plugin oxlint
Most consumers should use
@bensandee/config/oxlint/recommendedinstead, which bundles this plugin with a curated preset of oxlint built-in rules.
Usage
// oxlint.config.ts
import recommended from "@bensandee/eslint-plugin/recommended";
import { defineConfig } from "oxlint";
export default defineConfig({ extends: [recommended] });
Rules
All rules use the bensandee/ prefix.
General rules
| Rule | Description | Severity |
|---|---|---|
bensandee/no-type-assertion | Disallow as type assertions -- use Zod validation instead; as unknown as even in tests | error |
bensandee/no-inline-type-predicate | Disallow user-defined type predicates with inline { ... } targets | error |
bensandee/no-mixed-exports | Disallow mixing default and named exports | error |
bensandee/no-empty-catch | Disallow empty catch blocks without an exception parameter | error |
bensandee/no-zod-parse | Disallow .parse() -- use .safeParse() instead | error |
bensandee/no-plain-error | Disallow throw new Error(...) -- use typed errors from @bensandee/common | error |
bensandee/no-zod-any | Disallow z.any() -- use z.unknown() instead | error |
bensandee/no-unsafe-json-parse | Disallow JSON.parse() without Zod validation | error |
bensandee/no-unsafe-response-json | Disallow .json() on fetch responses without Zod validation | error |
bensandee/no-unsafe-exec | Disallow exec calls with interpolated command strings -- use arg-array form | error |
bensandee/no-anonymous-type | Disallow anonymous object types with 2+ members | warn |
bensandee/no-inline-query-keys | Disallow inline array query keys -- use a centralized query key factory | error |
bensandee/no-deep-relative-import | Disallow deeply nested relative imports -- use subpath imports (#/) | warn |
bensandee/no-plan-citation | Disallow plan/spec citations in comments -- lifecycle-managed docs/ paths and decision/task IDs | error |
bensandee/no-pr-citation | Disallow pull request and issue citations in comments | error |
bensandee/max-comment-lines | Disallow contiguous single-line comment blocks exceeding a line limit | warn |
bensandee/compat-expiry | Warn when a @compat backwards-compatibility marker has passed its date or version, or does not parse | warn |
bensandee/no-optional-nullable | Disallow redundant nullability (? with | null) | warn |
Hono rules
These rules self-gate via import detection -- they only fire in files that import from hono or hono/*.
| Rule | Description | Severity |
|---|---|---|
bensandee/hono-no-direct-fetch | Disallow direct fetch() in Hono projects -- use the typed client | error |
bensandee/hono-no-untyped-context | Disallow bare Context type -- require Context<Env> | error |
Exports
| Entry point | Description |
|---|---|
@bensandee/eslint-plugin | Plugin object with all rules (default export) |
@bensandee/eslint-plugin/recommended | Recommended oxlint config enabling all custom rules |
@bensandee/eslint-plugin/rules | Record of all rule implementations |
@bensandee/eslint-plugin/test-harness | Integration test harness for running rules against the oxlint binary |