|
2 | 2 | /loosey.cts(6,9): error TS2339: Property 'default' does not exist on type '{ version: number; }'.
|
3 | 3 | /main.mts(5,36): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.
|
4 | 4 | /main.mts(6,52): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.
|
5 |
| -/main.mts(8,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'. |
6 |
| -/main.mts(8,41): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. |
7 |
| -/main.mts(9,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. |
8 |
| -/main.mts(10,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. |
| 5 | +/main.mts(9,47): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. |
| 6 | +/main.mts(10,10): error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'. |
| 7 | +/main.mts(10,41): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. |
| 8 | +/main.mts(11,42): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. |
| 9 | +/main.mts(12,9): error TS2339: Property 'version' does not exist on type '{ default: { version: number; }; }'. |
9 | 10 |
|
10 | 11 |
|
11 | 12 | ==== /node_modules/not.json/package.json (0 errors) ====
|
|
42 | 43 | "version": 1
|
43 | 44 | }
|
44 | 45 |
|
45 |
| -==== /main.mts (6 errors) ==== |
| 46 | +==== /main.mts (7 errors) ==== |
46 | 47 | import { oops } from "not.json"; // Ok
|
47 | 48 | import moreOops from "actually-json"; // Error in nodenext
|
48 | 49 | import typed from "actually-json/typed"; // Error in nodenext
|
|
54 | 55 | ~~~~~~~~~~~~~~~~~~~~~
|
55 | 56 | !!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.
|
56 | 57 | import config2 from "./config.json"; // Error in nodenext, no attribute
|
| 58 | + import type config2Type from "./config.json"; // Ok, type-only |
| 59 | + import type config2Type2 from "./config.json" with { type: "json" }; // Error, import attributes not allowed on type-only imports |
| 60 | + ~~~~~~~~~~~~~~~~~~~~~ |
| 61 | +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'. |
57 | 62 | import { version } from "./config.json" with { type: "json" }; // Error, named import
|
58 | 63 | ~~~~~~~
|
59 | 64 | !!! error TS1544: Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to 'Node16'.
|
|
0 commit comments