-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove explicit any
types from the codebase
#208
Conversation
This change removes all use of `any` from the code and updates the `no-explicit-any` eslint rule to be an error.
🦋 Changeset detectedLatest commit: 479f3ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
||
type EventContext<Env, P extends string, Data> = { | ||
request: Request; | ||
waitUntil: (promise: Promise<any>) => void; | ||
waitUntil: (promise: Promise<unknown>) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think waitUntil
can return anything, so this should probably be void
waitUntil: (promise: Promise<unknown>) => void; | |
waitUntil: (promise: Promise<void>) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't do anything with the return, but I can still return something if I choose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitUntil(Promise.resolve(5))
is totally valid.
@@ -1,14 +1,12 @@ | |||
/* eslint-disable @typescript-eslint/no-explicit-any */ | |||
|
|||
import { match } from "path-to-regexp"; | |||
import type { HTTPMethod } from "./routes"; | |||
|
|||
/* TODO: Grab these from @cloudflare/workers-types instead */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I've said, I do hope to get rid of these entirely soon.
This change removes all use of
any
from the code and updates theno-explicit-any
eslint rule to be an error.Resolves #201