Skip to content

Commit d061f6b

Browse files
authored
Change typescript module to nodenext (#32757)
Typescript 5.7 changed semantics around JSON imports and `nodenext` is now [treated differently](https://devblogs.microsoft.com/typescript/announcing-typescript-5-7-beta/#validated-json-imports-in---module-nodenext) than `node16` for JSON imports and it requires the import attribute, so change the value to that and add the attribute to eliminate this typescript error. [`moduleResolution`](https://www.typescriptlang.org/tsconfig/#moduleResolution) is treated as an alias when `module` is `nodenext`, so we don't need to specify it. Also see microsoft/TypeScript#60589. It appears the next Typescript release will fix this for `node16`, but I guess it'll still be good to switch to `nodenext`.
1 parent 90d20be commit d061f6b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

tsconfig.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
],
88
"compilerOptions": {
99
"target": "es2020",
10-
"module": "node16",
11-
"moduleResolution": "node16",
10+
"module": "nodenext",
1211
"lib": ["dom", "dom.iterable", "dom.asynciterable", "esnext"],
1312
"allowImportingTsExtensions": true,
1413
"allowJs": true,

web_src/js/utils/match.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import emojis from '../../../assets/emoji.json';
1+
import emojis from '../../../assets/emoji.json' with {type: 'json'};
22
import {GET} from '../modules/fetch.ts';
33
import type {Issue} from '../types.ts';
44

0 commit comments

Comments
 (0)