@bensandee/eslint-plugin
v0.9.2
Published
Oxlint plugin with custom TypeScript lint rules for type safety, error handling, and code patterns.
Readme
@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 oxlintMost 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 | 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-anonymous-type | Disallow anonymous object types with 2+ members | error |
| 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 |
