Skip to content

Enable require-description-when-disabling lint rule on miniflare#13803

Merged
dario-piotrowicz merged 1 commit intomainfrom
dario/require-description-when-disabling/miniflare
May 5, 2026
Merged

Enable require-description-when-disabling lint rule on miniflare#13803
dario-piotrowicz merged 1 commit intomainfrom
dario/require-description-when-disabling/miniflare

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

This PR enables the require-description-when-disabling lint rule on the miniflare package.

This is a followup PR for #13698, #13703, #13710 and #13741.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: internal linting change
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal linting change

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 4, 2026

⚠️ No Changeset found

Latest commit: 197a4d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 4, 2026

The arrayCompare change is interesting. The type of encodedName is Uint8Array | undefined (since line 103 declares it as encodedName?: Uint8Array). By adding default parameter values = new Uint8Array(), the function now handles undefined gracefully instead of requiring the ! assertion. However, at the call site (line 110), a.encodedName and b.encodedName are always defined because every object pushed to keys on line 108 includes encodedName: encoder.encode(name). The default parameter acts as a type-level fix rather than a behavioral one, which is fine.

Now let me verify the parseInt(... ?? "NaN") pattern is semantically equivalent:

The old pattern was parseInt(someValue!) where someValue could be string | null. parseInt(null!) is indeed NaN because null gets coerced to the string "null", which isn't a number. The new pattern parseInt(someValue ?? "NaN") replaces null with "NaN", which also produces NaN from parseInt. These are semantically equivalent. Good.

Let me also check the DeferredPromise change once more — the use of assert instead of !:

The assert calls will narrow the types from T | undefined to T, which is correct. And unlike the ! operator, they actually enforce the invariant at runtime. This is a strict improvement.

This is a clean, well-structured lint-cleanup PR. All the changes are:

  1. Adding -- reason descriptions to existing eslint-disable comments (required by the newly enabled rule).
  2. Eliminating eslint-disable comments entirely by fixing the underlying code (replacing ! non-null assertions with ?? "NaN", using assert(), adding default parameters, or using narrower types).

All changes preserve existing behavior. No actionable issues found.

LGTM

github run

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13803

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13803

miniflare

npm i https://pkg.pr.new/miniflare@13803

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13803

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13803

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13803

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13803

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13803

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13803

wrangler

npm i https://pkg.pr.new/wrangler@13803

commit: 197a4d3

@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review May 4, 2026 22:01
@workers-devprod workers-devprod requested review from a team and edmundhung and removed request for a team May 4, 2026 22:02
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented May 4, 2026

Codeowners approval required for this PR:

  • @cloudflare/workers-kv
  • ✅ @cloudflare/wrangler
Show detailed file reviewers
  • packages/miniflare/src/workers/kv/namespace.worker.ts: [@cloudflare/workers-kv]
  • packages/miniflare/src/workers/kv/sites.worker.ts: [@cloudflare/workers-kv]

@dario-piotrowicz dario-piotrowicz added the no-changeset-required Skip PR check for valid changeset label May 4, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Member

@edmundhung edmundhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codeowners bypass

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 5, 2026
@dario-piotrowicz dario-piotrowicz merged commit 191021c into main May 5, 2026
75 of 78 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/require-description-when-disabling/miniflare branch May 5, 2026 10:24
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset-required Skip PR check for valid changeset

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants