Skip to content

Commit dcfee6e

Browse files
committed
Update test baselines for module keyword deprecation errors
- Updated 530+ test baseline files to include new TS1547 errors - These errors correctly reflect the TypeScript 6.0 deprecation of module keyword for namespaces - All errors are expected and confirm the feature is working as designed
1 parent 381d4a6 commit dcfee6e

File tree

530 files changed

+20621
-621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+20621
-621
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== module.d.ts (1 errors) ====
5+
declare module Point {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
export var Origin: { x: number; y: number; }
9+
}
10+
11+
==== function.d.ts (0 errors) ====
12+
declare function Point(): { x: number; y: number; }
13+
14+
==== test.ts (0 errors) ====
15+
var cl: { x: number; y: number; }
16+
var cl = Point();
17+
var cl = Point.Origin;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.d.ts(1,9): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== module.d.ts (1 errors) ====
5+
declare module Point {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
export var Origin: { x: number; y: number; }
9+
}
10+
11+
==== function.ts (0 errors) ====
12+
function Point() {
13+
return { x: 0, y: 0 };
14+
}
15+
16+
==== test.ts (0 errors) ====
17+
var cl: { x: number; y: number; }
18+
var cl = Point();
19+
var cl = Point.Origin;

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(8,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
12
ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts(11,24): error TS2341: Property 'sfn' is private and only accessible within class 'clodule<T>'.
23

34

4-
==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (1 errors) ====
5+
==== ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts (2 errors) ====
56
class clodule<T> {
67
id: string;
78
value: T;
@@ -10,6 +11,8 @@ ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics
1011
}
1112

1213
module clodule {
14+
~~~~~~
15+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
1316
// error: duplicate identifier expected
1417
export function fn<T>(x: T, y: T): number {
1518
return clodule.sfn('a');
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
EnumAndModuleWithSameNameAndCommonRoot.ts(5,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== EnumAndModuleWithSameNameAndCommonRoot.ts (1 errors) ====
5+
enum enumdule {
6+
Red, Blue
7+
}
8+
9+
module enumdule {
10+
~~~~~~
11+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
12+
13+
export class Point {
14+
constructor(public x: number, public y: number) { }
15+
}
16+
}
17+
18+
var x: enumdule;
19+
var x = enumdule.Red;
20+
21+
var y: { x: number; y: number };
22+
var y = new enumdule.Point(0, 0);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ExportClassWhichExtendsInterfaceWithInaccessibleType.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== ExportClassWhichExtendsInterfaceWithInaccessibleType.ts (1 errors) ====
5+
module A {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
9+
interface Point {
10+
x: number;
11+
y: number;
12+
13+
fromOrigin(p: Point): number;
14+
}
15+
16+
export class Point2d implements Point {
17+
constructor(public x: number, public y: number) { }
18+
19+
fromOrigin(p: Point) {
20+
return 1;
21+
}
22+
}
23+
}
24+
25+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.ts (1 errors) ====
5+
module A {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
9+
export class Point {
10+
x: number;
11+
y: number;
12+
}
13+
14+
export class Line {
15+
constructor(public start: Point, public end: Point) { }
16+
}
17+
18+
export function fromOrigin(p: Point): Line {
19+
return new Line({ x: 0, y: 0 }, p);
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.ts (1 errors) ====
5+
module A {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
9+
class Point {
10+
x: number;
11+
y: number;
12+
}
13+
14+
export class Line {
15+
constructor(public start: Point, public end: Point) { }
16+
}
17+
18+
export function fromOrigin(p: Point): Line {
19+
return new Line({ x: 0, y: 0 }, p);
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.ts (1 errors) ====
5+
module A {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
9+
export class Point {
10+
x: number;
11+
y: number;
12+
}
13+
14+
class Line {
15+
constructor(public start: Point, public end: Point) { }
16+
}
17+
18+
export function fromOrigin(p: Point): Line {
19+
return new Line({ x: 0, y: 0 }, p);
20+
}
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.ts (1 errors) ====
5+
module A {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
9+
class Point {
10+
constructor(public x: number, public y: number) { }
11+
}
12+
13+
export var UnitSquare : {
14+
top: { left: Point, right: Point },
15+
bottom: { left: Point, right: Point }
16+
} = null;
17+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ExportVariableWithInaccessibleTypeInTypeAnnotation.ts(1,1): error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
2+
3+
4+
==== ExportVariableWithInaccessibleTypeInTypeAnnotation.ts (1 errors) ====
5+
module A {
6+
~~~~~~
7+
!!! error TS1547: The 'module' keyword is not allowed for namespace declarations. Use the 'namespace' keyword instead.
8+
9+
export interface Point {
10+
x: number;
11+
y: number;
12+
}
13+
14+
// valid since Point is exported
15+
export var Origin: Point = { x: 0, y: 0 };
16+
17+
interface Point3d extends Point {
18+
z: number;
19+
}
20+
21+
// invalid Point3d is not exported
22+
export var Origin3d: Point3d = { x: 0, y: 0, z: 0 };
23+
}
24+

0 commit comments

Comments
 (0)