mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 16:44:26 +00:00
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 https://github.com/microsoft/TypeScript/issues/60589. It appears the next Typescript release will fix this for `node16`, but I guess it'll still be good to switch to `nodenext`.
This commit is contained in:
parent
90d20be541
commit
d061f6b70a
@ -7,8 +7,7 @@
|
|||||||
],
|
],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2020",
|
"target": "es2020",
|
||||||
"module": "node16",
|
"module": "nodenext",
|
||||||
"moduleResolution": "node16",
|
|
||||||
"lib": ["dom", "dom.iterable", "dom.asynciterable", "esnext"],
|
"lib": ["dom", "dom.iterable", "dom.asynciterable", "esnext"],
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import emojis from '../../../assets/emoji.json';
|
import emojis from '../../../assets/emoji.json' with {type: 'json'};
|
||||||
import {GET} from '../modules/fetch.ts';
|
import {GET} from '../modules/fetch.ts';
|
||||||
import type {Issue} from '../types.ts';
|
import type {Issue} from '../types.ts';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user