File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export const getEnvironment = (): EnvironmentVariables => {
4747declare 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
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { NetlifyGlobal } from '@netlify/types'
33declare 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments