honojs/hono

15 rules learned from 983 merged PRs: the files and habits in honojs/hono that kept needing a fix after merge.

Merged PRs read
983
Needed a fix
87 (9.0%)
Reverted
4
Merged between
2024-04-23 and 2026-11-07

Tested on PRs the rules had never seen

10 of the 48 code PRs that breached a rule needed a fix (21%), against 1 of the 28 that breached none (4%).

Rules were learned from older PRs, then tested on later PRs they hadn't seen. How we tested

PRTitle and the rule it breachedWhat happened
fix(reg-exp-router): support line terminators in route paths for v5Fragile area: src/router/ (8 of 39 earlier PRs needed a fix) fixed in #5552, 6 days later
feat!: add routable error and not-found middlewareFragile area: src/preset/ (3 of 6 earlier PRs needed a fix) fixed in #5563, 7 days later
fix(router): support a wildcard in the middle of a pathFragile area: src/router/ (8 of 39 earlier PRs needed a fix) fixed in #5556, 13 days later

Fix-prone files and folders

PRs that touched these paths needed a follow-up fix more often than the 9% repo average. Counts are PRs that touched the path.

  1. Hotspot: src/helper/adapter/index.ts

    5 of 9 earlier PRs that changed this needed a fix.

    4 clean, 5 fixed (56%)
  2. Hotspot: src/middleware/etag/digest.ts

    4 of 9 earlier PRs that changed this needed a fix.

    5 clean, 4 fixed (44%)
  3. Hotspot: src/helper/factory/index.ts

    8 of 21 earlier PRs that changed this needed a fix.

    13 clean, 8 fixed (38%)
  4. Hotspot: src/adapter/cloudflare-workers/websocket.ts

    3 of 8 earlier PRs that changed this needed a fix.

    5 clean, 3 fixed (38%)
  5. Fragile area: src/validator/

    12 of 33 earlier PRs that changed this needed a fix.

    21 clean, 12 fixed (36%)
  6. Hotspot: src/helper/streaming/sse.ts

    4 of 11 earlier PRs that changed this needed a fix.

    7 clean, 4 fixed (36%)
  7. Hotspot: src/utils/types.ts

    6 of 18 earlier PRs that changed this needed a fix.

    12 clean, 6 fixed (33%)
  8. Hotspot: src/types.ts

    15 of 47 earlier PRs that changed this needed a fix.

    32 clean, 15 fixed (32%)
  9. Hotspot: src/utils/body.ts

    4 of 13 earlier PRs that changed this needed a fix.

    9 clean, 4 fixed (31%)
  10. Hotspot: src/middleware/cors/index.ts

    4 of 13 earlier PRs that changed this needed a fix.

    9 clean, 4 fixed (31%)
  11. Hotspot: src/validator/validator.ts

    6 of 20 earlier PRs that changed this needed a fix.

    14 clean, 6 fixed (30%)
  12. Hotspot: src/middleware/etag/index.ts

    6 of 21 earlier PRs that changed this needed a fix.

    15 clean, 6 fixed (29%)
  13. Hotspot: src/hono-base.ts

    13 of 49 earlier PRs that changed this needed a fix.

    36 clean, 13 fixed (27%)
  14. Fragile area: src/client/

    15 of 65 earlier PRs that changed this needed a fix.

    50 clean, 15 fixed (23%)

Conventions

Habits most PRs here follow, where PRs that broke them needed a fix more often. Counts on each bar are the PRs that broke it.

  1. Titles follow "Conventional Commits (type(scope): summary)"

    98% of PR titles follow it. 3 of 20 earlier PRs that broke it needed a fix, and 84 of 943 that followed it.

    broken: 17 clean, 3 fixed (15%)

Recent PRs that needed a fix

Rules flagged 170 recent PRs, and 25 of those needed a fix (15%), against 9% of all recent PRs. These are the 15 with the strongest rule that needed a fix, with the PR that fixed each.

PRTitleSizeRule it breachedWhat happened
feat(types): passing middleware types +1,709 -216 touches src/helper/factory/index.ts13 clean, 8 fixed fixed in #4465, 2 days later
chore: bump linter and formatter +553 -480 touches src/helper/factory/index.ts13 clean, 8 fixed fixed in #4583, 11 days later
fix(types): cannot `.use` non-return mw from `createMiddleware` +25 -7 touches src/helper/factory/index.ts13 clean, 8 fixed fixed in #4492, 12 days later
feat!: add routable error and not-found middleware +2,303 -223 touches src/validator/21 clean, 12 fixed fixed in #5563, 7 days later
fix(utils/body,validator): normalize Content-Type media type for case-insensitive matching +107 -18 touches src/validator/21 clean, 12 fixed fixed in #5071, 2 days later
fix(sse): emit retry feild when retry is `0` +26 -3 touches src/helper/streaming/sse.ts7 clean, 4 fixed fixed in #5138, 3 days later
fix(types): replace schema-based path tracking with CurrentPath parameter +741 -302 touches src/types.ts32 clean, 15 fixed fixed in #4578, 1 day later
perf(types): optimize `MergeMiddlewareResponse` type +9 -8 touches src/types.ts32 clean, 15 fixed fixed in #4602, 1 day later
perf(cors): pre-join static array header options during initialization +30 -12 touches src/middleware/cors/index.ts9 clean, 4 fixed fixed in #5235, 4 days later
feat(etag): support conditional requests for the QUERY method +48 -1 touches src/middleware/etag/index.ts15 clean, 6 fixed fixed in #5196, 3 days later
chore!: remove deprecated `app.mount()` +10 -393 touches src/hono-base.ts36 clean, 13 fixed fixed in #5513, same day
chore!: remove deprecated APIs +5 -230 touches src/hono-base.ts36 clean, 13 fixed fixed in #5514, 11 days later
chore: let oxfmt sort imports instead of eslint +89 -87 touches src/client/50 clean, 15 fixed fixed in #5475, 5 days later
feat(client): Add `ApplyGlobalResponse` type helper for RPC Client +142 -2 touches src/client/50 clean, 15 fixed fixed in #4777, 11 days later
fix(client): skip undefined header and cookie values +82 -3 touches src/client/50 clean, 15 fixed fixed in #5280, same day

Get this for your own repo

Precall reads your repo's history the same way and comments on new PRs that touch the spots that kept breaking. Download the rules file for honojs/hono.