Skip to content

Commit e47cce7

Browse files
committed
Hotfix: Fix types from ndla/styled-system by setting moduleResolution to
Bundler
1 parent 2ad43fd commit e47cce7

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"react-dom": "^18.3.1",
132132
"react-helmet-async": "^1.3.0",
133133
"react-hook-form": "^7.51.3",
134-
"react-i18next": "^14.1.1",
134+
"react-i18next": "^14.1.2",
135135
"react-router-dom": "^6.3.0",
136136
"serialize-javascript": "^6.0.2",
137137
"source-map-support": "^0.5.9",

src/types/react-i18next.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88

99
import { Callback, FlatNamespace, i18n, KeyPrefix, Namespace, TFunction } from "i18next";
1010
import { FallbackNs, UseTranslationOptions } from "react-i18next";
11-
import { $Tuple } from "react-i18next/helpers";
1211
import { LocaleType } from "../interfaces";
1312

13+
// TS somehow considers this a namespace if we import it from react-i18next.
14+
export type $Tuple<T> = readonly [T?, ...T[]];
15+
1416
declare module "react-i18next" {
1517
interface CustomI18n extends Omit<i18n, "language" | "changeLanguage"> {
1618
language: LocaleType;

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"noFallthroughCasesInSwitch": true,
2626
"noUncheckedIndexedAccess": true,
2727

28-
"moduleResolution": "Node",
28+
"moduleResolution": "Bundler",
2929
"baseUrl": "src",
3030
"paths": {
3131
"*": ["node_modules/*", "src/types/*"]

yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -12659,7 +12659,7 @@ __metadata:
1265912659
react-dom: "npm:^18.3.1"
1266012660
react-helmet-async: "npm:^1.3.0"
1266112661
react-hook-form: "npm:^7.51.3"
12662-
react-i18next: "npm:^14.1.1"
12662+
react-i18next: "npm:^14.1.2"
1266312663
react-router-dom: "npm:^6.3.0"
1266412664
serialize-javascript: "npm:^6.0.2"
1266512665
sirv: "npm:^2.0.4"
@@ -14388,9 +14388,9 @@ __metadata:
1438814388
languageName: node
1438914389
linkType: hard
1439014390

14391-
"react-i18next@npm:^14.1.1":
14392-
version: 14.1.1
14393-
resolution: "react-i18next@npm:14.1.1"
14391+
"react-i18next@npm:^14.1.2":
14392+
version: 14.1.2
14393+
resolution: "react-i18next@npm:14.1.2"
1439414394
dependencies:
1439514395
"@babel/runtime": "npm:^7.23.9"
1439614396
html-parse-stringify: "npm:^3.0.1"
@@ -14402,7 +14402,7 @@ __metadata:
1440214402
optional: true
1440314403
react-native:
1440414404
optional: true
14405-
checksum: 10c0/d6da148d5dd1635f57d7a85bdd5c6e1f1404982112358a5efa9f6f47d505a00e4650237d5fc94b4381dcb336c134d500268a7157e06e2b2f0293a2bcd7ec2812
14405+
checksum: 10c0/cb8a83b3696639f083dc9f770d9d9e0681c0fe56f6b5fe24cd6facce08d363c37bd3440078e9d63abacabd7037b783e6b4e4d0c935de9c8dda7820bd4ef7e329
1440614406
languageName: node
1440714407
linkType: hard
1440814408

0 commit comments

Comments
 (0)