Skip to content

Commit 40c2469

Browse files
committed
Temporarily change version to demonstrate errors
1 parent 16fa207 commit 40c2469

File tree

23 files changed

+289
-121
lines changed

23 files changed

+289
-121
lines changed

src/compiler/corePublic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace ts {
55
// The following is baselined as a literal template type without intervention
66
/** The version of the TypeScript compiler release */
77
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
8-
export const version: string = `${versionMajorMinor}.0-dev`;
8+
export const version: string = `${versionMajorMinor}.0`;
99

1010
/**
1111
* Type of objects whose values are all of the same type.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
tests/cases/conformance/node/other.cts(3,14): error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2+
tests/cases/conformance/node/other.cts(4,14): error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
3+
tests/cases/conformance/node/other2.cts(3,14): error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
4+
5+
6+
==== tests/cases/conformance/node/index.ts (0 errors) ====
7+
// esm format file
8+
export {};
9+
==== tests/cases/conformance/node/index.mts (0 errors) ====
10+
// esm format file
11+
export {};
12+
==== tests/cases/conformance/node/index.cts (0 errors) ====
13+
// cjs format file
14+
export {};
15+
==== tests/cases/conformance/node/other.ts (0 errors) ====
16+
// esm format file
17+
export const a = await import("package/cjs");
18+
export const b = await import("package/mjs");
19+
export const c = await import("package");
20+
export const f = await import("inner");
21+
==== tests/cases/conformance/node/other2.ts (0 errors) ====
22+
// esm format file
23+
export const d = await import("inner/cjs");
24+
export const e = await import("inner/mjs");
25+
==== tests/cases/conformance/node/other.mts (0 errors) ====
26+
// esm format file
27+
export const a = await import("package/cjs");
28+
export const b = await import("package/mjs");
29+
export const c = await import("package");
30+
export const f = await import("inner");
31+
==== tests/cases/conformance/node/other2.mts (0 errors) ====
32+
// esm format file
33+
export const d = await import("inner/cjs");
34+
export const e = await import("inner/mjs");
35+
==== tests/cases/conformance/node/other.cts (2 errors) ====
36+
// cjs format file, no TLA
37+
export const a = import("package/cjs");
38+
export const b = import("package/mjs");
39+
~
40+
!!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
41+
export const c = import("package");
42+
~
43+
!!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
44+
export const f = import("inner");
45+
==== tests/cases/conformance/node/other2.cts (1 errors) ====
46+
// cjs format file, no TLA
47+
export const d = import("inner/cjs");
48+
export const e = import("inner/mjs");
49+
~
50+
!!! error TS2841: The type of this expression cannot be named without a resolution mode assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
51+
==== tests/cases/conformance/node/node_modules/inner/index.d.ts (0 errors) ====
52+
// cjs format file
53+
export const cjsMain = true;
54+
==== tests/cases/conformance/node/node_modules/inner/index.d.mts (0 errors) ====
55+
// esm format file
56+
export const esm = true;
57+
==== tests/cases/conformance/node/node_modules/inner/index.d.cts (0 errors) ====
58+
// cjs format file
59+
export const cjsNonmain = true;
60+
==== tests/cases/conformance/node/package.json (0 errors) ====
61+
{
62+
"name": "package",
63+
"private": true,
64+
"type": "module",
65+
"exports": {
66+
"./cjs": "./index.cjs",
67+
"./mjs": "./index.mjs",
68+
".": "./index.js"
69+
}
70+
}
71+
==== tests/cases/conformance/node/node_modules/inner/package.json (0 errors) ====
72+
{
73+
"name": "inner",
74+
"private": true,
75+
"exports": {
76+
"./cjs": "./index.cjs",
77+
"./mjs": "./index.mjs",
78+
".": "./index.js"
79+
}
80+
}

tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js

-16
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,3 @@ export declare const d: {
153153
cjsNonmain: true;
154154
};
155155
export declare const e: typeof import("inner/mjs");
156-
//// [other.d.cts]
157-
export declare const a: Promise<{
158-
default: typeof import("./index.cjs");
159-
}>;
160-
export declare const b: Promise<typeof import("./index.mjs", { assert: { "resolution-mode": "import" } })>;
161-
export declare const c: Promise<typeof import("./index.js", { assert: { "resolution-mode": "import" } })>;
162-
export declare const f: Promise<{
163-
default: typeof import("inner");
164-
cjsMain: true;
165-
}>;
166-
//// [other2.d.cts]
167-
export declare const d: Promise<{
168-
default: typeof import("inner/cjs");
169-
cjsNonmain: true;
170-
}>;
171-
export declare const e: Promise<typeof import("inner/mjs", { assert: { "resolution-mode": "import" } })>;

tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).errors.txt

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
1+
/index.ts(1,45): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2+
/index.ts(2,44): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
13
/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
4+
/index.ts(6,50): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
25
/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'.
36
/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
7+
/index.ts(7,49): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
8+
/index.ts(10,45): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
9+
/index.ts(11,44): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
410

511

6-
==== /index.ts (3 errors) ====
12+
==== /index.ts (9 errors) ====
713
import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
816
import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
919

1020
export interface LocalInterface extends RequireInterface, ImportInterface {}
1121

1222
import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" };
1323
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1424
!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
25+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
1527
import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" };
1628
~~~~~~~~~~~~~~~
1729
!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'.
1830
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1931
!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2034
export interface Loc extends Req, Imp {}
2135

2236
export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
37+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2339
export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2442

2543
==== /node_modules/pkg/package.json (0 errors) ====
2644
{

tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=node16).js

-13
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,3 @@ export type { ImportInterface } from "pkg" assert { "resolution-mode": "import"
3030
//// [index.js]
3131
"use strict";
3232
Object.defineProperty(exports, "__esModule", { value: true });
33-
34-
35-
//// [index.d.ts]
36-
import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
37-
import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
38-
export interface LocalInterface extends RequireInterface, ImportInterface {
39-
}
40-
import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" };
41-
import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" };
42-
export interface Loc extends Req, Imp {
43-
}
44-
export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
45-
export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };

tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).errors.txt

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
1+
/index.ts(1,45): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2+
/index.ts(2,44): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
13
/index.ts(6,50): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls.
4+
/index.ts(6,50): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
25
/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'.
36
/index.ts(7,49): error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls.
7+
/index.ts(7,49): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
8+
/index.ts(10,45): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
9+
/index.ts(11,44): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
410

511

6-
==== /index.ts (3 errors) ====
12+
==== /index.ts (9 errors) ====
713
import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
816
import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
919

1020
export interface LocalInterface extends RequireInterface, ImportInterface {}
1121

1222
import {type RequireInterface as Req} from "pkg" assert { "resolution-mode": "require" };
1323
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1424
!!! error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls.
25+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
1527
import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" };
1628
~~~~~~~~~~~~~~~
1729
!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'.
1830
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1931
!!! error TS2836: Import assertions are not allowed on statements that transpile to commonjs 'require' calls.
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2034
export interface Loc extends Req, Imp {}
2135

2236
export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
37+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2339
export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2442

2543
==== /node_modules/pkg/package.json (0 errors) ====
2644
{

tests/baselines/reference/nodeModulesImportModeDeclarationEmit1(module=nodenext).js

-13
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,3 @@ export type { ImportInterface } from "pkg" assert { "resolution-mode": "import"
3030
//// [index.js]
3131
"use strict";
3232
Object.defineProperty(exports, "__esModule", { value: true });
33-
34-
35-
//// [index.d.ts]
36-
import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
37-
import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
38-
export interface LocalInterface extends RequireInterface, ImportInterface {
39-
}
40-
import { type RequireInterface as Req } from "pkg" assert { "resolution-mode": "require" };
41-
import { type ImportInterface as Imp } from "pkg" assert { "resolution-mode": "import" };
42-
export interface Loc extends Req, Imp {
43-
}
44-
export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
45-
export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };

tests/baselines/reference/nodeModulesImportModeDeclarationEmit2(module=node16).errors.txt

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1+
/index.ts(1,45): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2+
/index.ts(2,44): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
13
/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'.
24
/index.ts(6,50): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
5+
/index.ts(6,50): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
36
/index.ts(7,49): error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
7+
/index.ts(7,49): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
8+
/index.ts(10,45): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
9+
/index.ts(11,44): error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
410

511

6-
==== /index.ts (3 errors) ====
12+
==== /index.ts (9 errors) ====
713
import type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
816
import type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
919

1020
export interface LocalInterface extends RequireInterface, ImportInterface {}
1121

@@ -14,13 +24,21 @@
1424
!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'.
1525
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1626
!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
27+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
1729
import {type ImportInterface as Imp} from "pkg" assert { "resolution-mode": "import" };
1830
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1931
!!! error TS2821: Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'.
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2034
export interface Loc extends Req, Imp {}
2135

2236
export type { RequireInterface } from "pkg" assert { "resolution-mode": "require" };
37+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2339
export type { ImportInterface } from "pkg" assert { "resolution-mode": "import" };
40+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41+
!!! error TS4125: Resolution mode assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.
2442

2543
==== /node_modules/pkg/package.json (0 errors) ====
2644
{

0 commit comments

Comments
 (0)