npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-hono

v1.4.0

Published

ESLint plugin for Hono and all Hono lovers

Readme


npm version npm downloads Socket Badge GitHub last commit Test Lint and Format CodeRabbit Pull Request Reviews License: MIT

🔥 ESLint plugin for Hono and all Hono lovers

Installation

npm install -D eslint-plugin-hono

Requires ESLint 9 or later (flat config).

Usage

Add the recommended configuration to your eslint.config.js:

import hono from "eslint-plugin-hono";

export default [
    hono.configs.recommended,
];

The config registers the plugin for you — there is no need to declare plugins yourself.

To enable every rule, including the stylistic and runtime-specific ones, use all instead:

import hono from "eslint-plugin-hono";

export default [
    hono.configs.all,
];

To apply the rules only to specific files, or to tweak individual rules, spread the config and add your own entry after it:

import tseslint from "typescript-eslint";
import hono from "eslint-plugin-hono";

export default [
    ...tseslint.configs.recommended,
    {
        ...hono.configs.recommended,
        files: ["src/**/*.ts"],
    },
    {
        files: ["src/**/*.ts"],
        rules: {
            "hono/no-process-env": "error",
            "hono/route-grouping": "warn",
        },
    },
];

Rules

Each rule links to its own documentation page.

✅ = enabled in recommended. All rules are enabled in all. 🔧 = automatically fixable by the --fix CLI option.

| Rule | Description | ✅ | Severity in all | 🔧 | | :--- | :--- | :---: | :---: | :---: | | param-name-mismatch | Ensure parameter name in c.req.param() matches the route definition | ✅ | 🚨 error | | | no-duplicate-path-params | Disallow declaring the same path parameter name twice in one route path (/users/:id/posts/:id) | ✅ | 🚨 error | | | no-duplicate-routes | Disallow registering the same route (HTTP method and path) more than once, including across basePath() and app.route() | ✅ | 🚨 error | | | no-multiple-next | Disallow multiple calls to next() in a single middleware execution path | ✅ | 🚨 error | | | no-unused-context-response | Disallow unused calls to Context response methods (c.json, c.text, etc.) | ✅ | 🚨 error | | | prefer-http-exception | Suggest using HTTPException instead of generic Error for HTTP errors | ✅ | ⚠️ warn | | | no-commented-out-route | Disallow commented-out Hono routes and middleware (app.get(...), app.use(...), etc.) | ✅ | ⚠️ warn | | | max-path-name-length | Enforce a maximum length for each /-separated segment of a route path (default: 30) | ✅ | ⚠️ warn | | | route-grouping | Enforce grouping and ordering of routes by HTTP method and Hono instance | | ⚠️ warn | 🔧 | | no-process-env | Disallow the use of process.env in favor of c.env | | ⚠️ warn | | | global-middleware-placement | Enforce that global middleware is placed before route definitions | | ⚠️ warn | | | max-return | Enforce a maximum number of return statements in a single route handler (default: 5) | | ⚠️ warn | | | valid-route-path | Enforce naming conventions on route paths (mustMatch, mustNotMatch, disallowedWords) | | ⚠️ warn | | | basepath-variable-name | Enforce that a variable holding a basePath() instance is named after its base path | | ⚠️ warn | 🔧 | | hono-instance-name | Enforce a required prefix and/or suffix (prefixes, suffixes) on variables holding a new Hono() instance; basePath() instances are left to basepath-variable-name | | ⚠️ warn | |

recommended deliberately contains only the rules that catch real bugs and are safe for any Hono project, plus max-path-name-length, whose generous default limit only flags endpoint names that are almost certainly a design smell. Stylistic rules (route-grouping, global-middleware-placement) and runtime-specific ones (no-process-env — process.env is perfectly valid on Node.js, Bun and Deno) are left out so that adding this plugin to an existing project does not flood it with errors.

License

MIT