Unified · Split
| @@ -41,6 +41,7 @@ export function ScopeProvider(props: React.PropsWithChildren<{ fallback?: React. · 40 unmodified lines | ||
| 41 | 41 | export function useScope(): ScopeId { |
| 42 | 42 | const scope = React.useContext(ScopeContext); |
| 43 | 43 | if (scope === null) { |
| 44 | + // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant | |
| 44 | 45 | throw new Error("useScope must be used inside a ScopeProvider"); |
| 45 | 46 | } |
| 46 | 47 | return scope.id; |
| @@ -53,6 +54,7 @@ export function useScope(): ScopeId { · 6 unmodified lines | ||
| 53 | 54 | export function useScopeInfo(): ScopeInfo { |
| 54 | 55 | const scope = React.useContext(ScopeContext); |
| 55 | 56 | if (scope === null) { |
| 57 | + // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant | |
| 56 | 58 | throw new Error("useScopeInfo must be used inside a ScopeProvider"); |
| 57 | 59 | } |
| 58 | 60 | return scope; |
| @@ -66,6 +68,7 @@ export function useUserScope(): ScopeId { · 7 unmodified lines | ||
| 66 | 68 | const stack = useScopeStack(); |
| 67 | 69 | const innermost = stack[0]; |
| 68 | 70 | if (!innermost) { |
| 71 | + // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant | |
| 69 | 72 | throw new Error("useUserScope requires a non-empty scope stack"); |
| 70 | 73 | } |
| 71 | 74 | return innermost.id; |