|
5 | 5 | /loosey.cts(1,36): error TS2856: Import attributes are not allowed on statements that compile to CommonJS 'require' calls.
|
6 | 6 | +/loosey.cts(2,8): error TS1259: Module '"/config"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
|
7 | 7 | /loosey.cts(6,9): error TS2339: Property 'default' does not exist on type '{ version: number; }'.
|
8 |
| --/main.mts(2,22): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
9 |
| --/main.mts(3,19): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
10 |
| --/main.mts(7,21): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
11 |
| -+/main.mts(2,22): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'ModuleKindNode18'. |
12 |
| -+/main.mts(3,19): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'ModuleKindNode18'. |
13 |
| -+/main.mts(7,21): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'ModuleKindNode18'. |
14 |
| - /main.mts(9,47): error TS2857: Import attributes cannot be used with type-only imports or exports. |
15 |
| --/main.mts(10,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node18'. |
16 |
| -+/main.mts(10,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'ModuleKindNode18'. |
17 |
| - /main.mts(12,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. |
18 |
| - |
19 |
| - |
20 |
| -@@= skipped -45, +47 lines =@@ |
21 |
| - import { oops } from "not.json"; // Ok |
22 |
| - import moreOops from "actually-json"; // Error in nodenext |
23 |
| - ~~~~~~~~~~~~~~~ |
24 |
| --!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
25 |
| -+!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'ModuleKindNode18'. |
26 |
| - import typed from "actually-json/typed"; // Error in nodenext |
27 |
| - ~~~~~~~~~~~~~~~~~~~~~ |
28 |
| --!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
29 |
| -+!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'ModuleKindNode18'. |
30 |
| - |
31 |
| - import config from "./config.json" with { type: "json" }; // Ok |
32 |
| - import { default as config1 } from "./config.json" with { type: "json" }; // Ok |
33 |
| - import config2 from "./config.json"; // Error in nodenext, no attribute |
34 |
| - ~~~~~~~~~~~~~~~ |
35 |
| --!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
36 |
| -+!!! error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'ModuleKindNode18'. |
37 |
| - import type config2Type from "./config.json"; // Ok, type-only |
38 |
| - import type config2Type2 from "./config.json" with { type: "json" }; // Error, import attributes not allowed on type-only imports |
39 |
| - ~~~~~~~~~~~~~~~~~~~~~ |
40 |
| - !!! error TS2857: Import attributes cannot be used with type-only imports or exports. |
41 |
| - import { version } from "./config.json" with { type: "json" }; // Error, named import |
42 |
| - ~~~~~~~ |
43 |
| --!!! error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node18'. |
44 |
| -+!!! error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'ModuleKindNode18'. |
45 |
| - import * as config3 from "./config.json" with { type: "json" }; |
46 |
| - config3.version; // Error |
47 |
| - ~~~~~~~ |
| 8 | + /main.mts(2,22): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
| 9 | + /main.mts(3,19): error TS1543: Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to 'Node18'. |
| 10 | +@@= skipped -68, +70 lines =@@ |
48 | 11 | !!! error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'.
|
49 | 12 | config3.default; // Ok
|
50 | 13 |
|
|
0 commit comments