Oxlint Plugin
oxlint-plugin-hyper-fetch brings the HyperFetch lint rules to Oxlint. It
catches typos, unknown keys and malformed generics in createClient and createRequest, the mistakes TypeScript lets
through because every generic key is optional. Rule names match the ESLint plugin, so you can
switch linters without touching your rule config.
- Catch generic typos:
rsponseinstead ofresponsesilently types your data asunknown. The plugin flags it. - Lint fast: on the HyperFetch codebase the plugin runs about 16x faster than the ESLint plugin.
- Migrate in one step: the rules are named the same as in
eslint-plugin-hyper-fetch.
Install the Plugin
- npm
- yarn
- pnpm
npm install -D oxlint oxlint-plugin-hyper-fetch
yarn add -D oxlint oxlint-plugin-hyper-fetch
pnpm add -D oxlint oxlint-plugin-hyper-fetch
The plugin needs Oxlint 1.62.0 or newer.
Configuration
Add the plugin to jsPlugins in .oxlintrc.json and turn the rules on.
{
"jsPlugins": ["oxlint-plugin-hyper-fetch"],
"rules": {
"hyper-fetch/client-generic-types": "error",
"hyper-fetch/request-generic-types": "error"
}
}
With a TypeScript config, the same goes into defineConfig.
import { defineConfig } from "oxlint";
export default defineConfig({
jsPlugins: ["oxlint-plugin-hyper-fetch"],
rules: {
"hyper-fetch/client-generic-types": "error",
"hyper-fetch/request-generic-types": "error",
},
});
Each rule accepts "off", "warn" or "error". See the rules for what each one reports.
Migrating from ESLint
Rule ids are the same, so only the plugin registration changes.
{
"plugins": ["hyper-fetch"],
"jsPlugins": ["oxlint-plugin-hyper-fetch"],
"rules": {
"hyper-fetch/client-generic-types": "error",
"hyper-fetch/request-generic-types": "error"
}
}
Why it is fast
Oxlint parses every file in Rust. Handing the AST to a JS plugin is the expensive part, so both rules look at the source text first and skip any file that cannot contain a mistake.
request-generic-typesonly runs where the text hascreateRequest<.client-generic-typesonly runs where the text mentions both@hyper-fetch/coreandcreateClient.
Skipped files never have their AST built for the plugin, so only the files that define requests or clients add to your lint time.
oxlint-plugin-hyper-fetchruns the HyperFetch generic checks on Oxlint.- Register it in
jsPluginsand enablehyper-fetch/client-generic-typesandhyper-fetch/request-generic-types. - Rule ids match the ESLint plugin, so migrating only changes how the plugin is loaded.

