From 1655a93bdd2f2636730b943be90e2812fe8b57dc Mon Sep 17 00:00:00 2001 From: Sreetam Das Date: Sun, 23 Apr 2023 22:58:10 +0530 Subject: [PATCH] fix: skip `INVALID_CLIENT_ENTRY_PROP` warning for `global-error` --- packages/next/src/server/typescript/rules/client-boundary.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next/src/server/typescript/rules/client-boundary.ts b/packages/next/src/server/typescript/rules/client-boundary.ts index f6ce8bbab4742..7e134d4b2cc99 100644 --- a/packages/next/src/server/typescript/rules/client-boundary.ts +++ b/packages/next/src/server/typescript/rules/client-boundary.ts @@ -40,6 +40,7 @@ const clientBoundary = { const diagnostics: ts.Diagnostic[] = [] const isErrorFile = /[\\/]error\.tsx?$/.test(source.fileName) + const isGlobalErrorFile = /[\\/]global-error\.tsx?$/.test(source.fileName) const props = node.parameters?.[0]?.name if (props && ts.isObjectBindingPattern(props)) { @@ -57,7 +58,7 @@ const clientBoundary = { // There's a special case for the error file that the `reset` prop is allowed // to be a function: // https://github.com/vercel/next.js/issues/46573 - if (!isErrorFile || propName !== 'reset') { + if (!(isErrorFile || isGlobalErrorFile) || propName !== 'reset') { diagnostics.push({ file: source, category: ts.DiagnosticCategory.Warning,