|
1 | | -1.ts(1,14): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
2 | | -1.ts(2,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
3 | | -1.ts(3,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
4 | | -2.ts(1,28): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
5 | | -2.ts(2,38): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 1 | +1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 2 | +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 3 | +1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 4 | +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 5 | +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
6 | 6 | 3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
7 | 7 | 3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
8 | 8 | 3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
|
11 | 11 | 3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments |
12 | 12 | 3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
13 | 13 | 3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
14 | | -3.ts(10,52): error TS1009: Trailing comma not allowed. |
| 14 | +3.ts(10,50): error TS1009: Trailing comma not allowed. |
15 | 15 |
|
16 | 16 |
|
17 | 17 | ==== 0.ts (0 errors) ==== |
18 | 18 | export const a = 1; |
19 | 19 | export const b = 2; |
20 | 20 |
|
21 | 21 | ==== 1.ts (3 errors) ==== |
22 | | - import './0' assert { type: "json" } |
23 | | - ~~~~~~~~~~~~~~~~~~~~~~~ |
24 | | -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
25 | | - import { a, b } from './0' assert { "type": "json" } |
26 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~ |
27 | | -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
28 | | - import * as foo from './0' assert { type: "json" } |
| 22 | + import './0' with { type: "json" } |
| 23 | + ~~~~~~~~~~~~~~~~~~~~~ |
| 24 | +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 25 | + import { a, b } from './0' with { "type": "json" } |
29 | 26 | ~~~~~~~~~~~~~~~~~~~~~~~ |
30 | | -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 27 | +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 28 | + import * as foo from './0' with { type: "json" } |
| 29 | + ~~~~~~~~~~~~~~~~~~~~~ |
| 30 | +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
31 | 31 | a; |
32 | 32 | b; |
33 | 33 | foo.a; |
34 | 34 | foo.b; |
35 | 35 |
|
36 | 36 | ==== 2.ts (2 errors) ==== |
37 | | - import { a, b } from './0' assert {} |
38 | | - ~~~~~~~~~ |
39 | | -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
40 | | - import { a as c, b as d } from './0' assert { a: "a", b: "b", c: "c" } |
41 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
42 | | -!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 37 | + import { a, b } from './0' with {} |
| 38 | + ~~~~~~~ |
| 39 | +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
| 40 | + import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } |
| 41 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 42 | +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'node20', 'nodenext', or 'preserve'. |
43 | 43 | a; |
44 | 44 | b; |
45 | 45 | c; |
46 | 46 | d; |
47 | 47 |
|
48 | 48 | ==== 3.ts (9 errors) ==== |
49 | 49 | const a = import('./0') |
50 | | - const b = import('./0', { assert: { type: "json" } }) |
51 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 50 | + const b = import('./0', { with: { type: "json" } }) |
| 51 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
52 | 52 | !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
53 | | - const c = import('./0', { assert: { type: "json", ttype: "typo" } }) |
54 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 53 | + const c = import('./0', { with: { type: "json", ttype: "typo" } }) |
| 54 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
55 | 55 | !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
56 | | - const d = import('./0', { assert: {} }) |
57 | | - ~~~~~~~~~~~~~~ |
| 56 | + const d = import('./0', { with: {} }) |
| 57 | + ~~~~~~~~~~~~ |
58 | 58 | !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
59 | 59 | const dd = import('./0', {}) |
60 | 60 | ~~ |
|
69 | 69 | const g = import('./0', {}, {}) |
70 | 70 | ~~ |
71 | 71 | !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
72 | | - const h = import('./0', { assert: { type: "json" }},) |
73 | | - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 72 | + const h = import('./0', { with: { type: "json" }},) |
| 73 | + ~~~~~~~~~~~~~~~~~~~~~~~~~ |
74 | 74 | !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'node20', 'nodenext', or 'preserve'. |
75 | | - ~ |
| 75 | + ~ |
76 | 76 | !!! error TS1009: Trailing comma not allowed. |
77 | 77 |
|
78 | 78 |
|
0 commit comments