Skip to content

Commit 4e4e639

Browse files
author
Tom Lienard
authored
fix(use-i18n): oom when running eslint (#1461)
1 parent 296fc84 commit 4e4e639

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/chilly-tigers-bathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@scaleway/use-i18n': patch
3+
---
4+
5+
Fix OOM when running eslint

packages/use-i18n/src/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ import type {
33
LocaleKeys,
44
LocaleValue,
55
Params,
6-
ScopedValue,
76
Scopes,
87
} from 'international-types'
98
import type { ReactNode } from 'react'
109

10+
export type ScopedValue<
11+
Locale extends BaseLocale,
12+
Scope extends Scopes<Locale> | undefined,
13+
Key extends LocaleKeys<Locale, Scope>,
14+
> = Scope extends undefined ? Locale[Key] : Locale[`${Scope}.${Key}`]
15+
1116
export type ReactParamsObject<Value extends LocaleValue> = Record<
1217
Params<Value>[number],
1318
LocaleValue | ReactNode

0 commit comments

Comments
 (0)