Skip to content

Commit b51576d

Browse files
authored
Merge branch 'main' into test/function-304
2 parents e458ad3 + f6eec1d commit b51576d

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

packages/blobs/src/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const getEnvironment = (): EnvironmentVariables => {
4747
declare global {
4848
// Using `var` so that the declaration is hoisted in such a way that we can
4949
// reference it before it's initialized.
50-
// eslint-disable-next-line no-var
50+
5151
var netlifyBlobsContext: unknown
5252
}
5353

packages/cache/src/fetchwithcache.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ export const fetchWithCache: FetchWithCache = async (
134134
if (onCachePut) {
135135
await onCachePut(cachePut)
136136
} else {
137-
const requestContext = (globalThis as GlobalScope).Netlify?.context
137+
// NOTE: when `requestContext` is assigned via a single expression here, we
138+
// hit some `@typescript-eslint/no-unsafe-assignment` bug. TODO(serhalp): try
139+
// to reduce this down to a minimal repro and file an issue.
140+
const netlifyGlobal: NetlifyGlobal | undefined = (globalThis as GlobalScope).Netlify
141+
const requestContext = netlifyGlobal?.context
138142

139143
if (requestContext) {
140144
requestContext.waitUntil(cachePut)

packages/edge-functions/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { NetlifyGlobal } from '@netlify/types'
33
declare global {
44
// Using `var` so that the declaration is hoisted in such a way that we can
55
// reference it before it's initialized.
6-
// eslint-disable-next-line no-var
6+
77
var Netlify: NetlifyGlobal
88
}
99

packages/runtime/src/lib/globals.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ declare global {
77
// Using `var` so that the declaration is hoisted in such a way that we can
88
// reference it before it's initialized.
99

10-
// eslint-disable-next-line no-var
1110
var Netlify: NetlifyGlobal
1211
}
1312

0 commit comments

Comments
 (0)