Skip to content

Commit 2ef393b

Browse files
Add full stops in diagnostic messages (#40165)
* Add full stops in diagnostic messages (fixes #37753) * Accept baselines * Fix whitespace
1 parent e5fd0dd commit 2ef393b

35 files changed

+158
-158
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@
936936
"category": "Error",
937937
"code": 1325
938938
},
939-
"Dynamic import cannot have type arguments": {
939+
"Dynamic import cannot have type arguments.": {
940940
"category": "Error",
941941
"code": 1326
942942
},
@@ -1008,7 +1008,7 @@
10081008
"category": "Error",
10091009
"code": 1344
10101010
},
1011-
"An expression of type 'void' cannot be tested for truthiness": {
1011+
"An expression of type 'void' cannot be tested for truthiness.": {
10121012
"category": "Error",
10131013
"code": 1345
10141014
},
@@ -2278,7 +2278,7 @@
22782278
"category": "Error",
22792279
"code": 2575
22802280
},
2281-
"Property '{0}' is a static member of type '{1}'": {
2281+
"Property '{0}' is a static member of type '{1}'.": {
22822282
"category": "Error",
22832283
"code": 2576
22842284
},
@@ -2784,7 +2784,7 @@
27842784
"category": "Error",
27852785
"code": 2731
27862786
},
2787-
"Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension": {
2787+
"Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension.": {
27882788
"category": "Error",
27892789
"code": 2732
27902790
},
@@ -4365,7 +4365,7 @@
43654365
"category": "Message",
43664366
"code": 6204
43674367
},
4368-
"All type parameters are unused": {
4368+
"All type parameters are unused.": {
43694369
"category": "Error",
43704370
"code": 6205
43714371
},
@@ -5900,7 +5900,7 @@
59005900
"category": "Error",
59015901
"code": 18007
59025902
},
5903-
"Private identifiers cannot be used as parameters": {
5903+
"Private identifiers cannot be used as parameters.": {
59045904
"category": "Error",
59055905
"code": 18009
59065906
},
@@ -5940,7 +5940,7 @@
59405940
"category": "Error",
59415941
"code": 18018
59425942
},
5943-
"'{0}' modifier cannot be used with a private identifier": {
5943+
"'{0}' modifier cannot be used with a private identifier.": {
59445944
"category": "Error",
59455945
"code": 18019
59465946
},

tests/baselines/reference/classImplementsClass6.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/classImplementsClass6.ts(20,3): error TS2339: Property 'bar' does not exist on type 'C'.
2-
tests/cases/compiler/classImplementsClass6.ts(21,4): error TS2576: Property 'bar' is a static member of type 'C2'
2+
tests/cases/compiler/classImplementsClass6.ts(21,4): error TS2576: Property 'bar' is a static member of type 'C2'.
33

44

55
==== tests/cases/compiler/classImplementsClass6.ts (2 errors) ====
@@ -27,4 +27,4 @@ tests/cases/compiler/classImplementsClass6.ts(21,4): error TS2576: Property 'bar
2727
!!! error TS2339: Property 'bar' does not exist on type 'C'.
2828
c2.bar(); // should error
2929
~~~
30-
!!! error TS2576: Property 'bar' is a static member of type 'C2'
30+
!!! error TS2576: Property 'bar' is a static member of type 'C2'.

tests/baselines/reference/classSideInheritance1.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/compiler/classSideInheritance1.ts(12,3): error TS2576: Property 'bar' is a static member of type 'A'
2-
tests/cases/compiler/classSideInheritance1.ts(13,3): error TS2576: Property 'bar' is a static member of type 'C2'
1+
tests/cases/compiler/classSideInheritance1.ts(12,3): error TS2576: Property 'bar' is a static member of type 'A'.
2+
tests/cases/compiler/classSideInheritance1.ts(13,3): error TS2576: Property 'bar' is a static member of type 'C2'.
33

44

55
==== tests/cases/compiler/classSideInheritance1.ts (2 errors) ====
@@ -16,9 +16,9 @@ tests/cases/compiler/classSideInheritance1.ts(13,3): error TS2576: Property 'bar
1616
var c: C2;
1717
a.bar(); // static off an instance - should be an error
1818
~~~
19-
!!! error TS2576: Property 'bar' is a static member of type 'A'
19+
!!! error TS2576: Property 'bar' is a static member of type 'A'.
2020
c.bar(); // static off an instance - should be an error
2121
~~~
22-
!!! error TS2576: Property 'bar' is a static member of type 'C2'
22+
!!! error TS2576: Property 'bar' is a static member of type 'C2'.
2323
A.bar(); // valid
2424
C2.bar(); // valid

tests/baselines/reference/classStaticPropertyAccess.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/compiler/classStaticPropertyAccess.ts(9,1): error TS2576: Property 'y' is a static member of type 'A'
2-
tests/cases/compiler/classStaticPropertyAccess.ts(10,3): error TS2576: Property 'y' is a static member of type 'A'
1+
tests/cases/compiler/classStaticPropertyAccess.ts(9,1): error TS2576: Property 'y' is a static member of type 'A'.
2+
tests/cases/compiler/classStaticPropertyAccess.ts(10,3): error TS2576: Property 'y' is a static member of type 'A'.
33
tests/cases/compiler/classStaticPropertyAccess.ts(11,3): error TS2341: Property '_b' is private and only accessible within class 'A'.
44
tests/cases/compiler/classStaticPropertyAccess.ts(12,3): error TS2339: Property 'a' does not exist on type 'typeof A'.
55

@@ -15,10 +15,10 @@ tests/cases/compiler/classStaticPropertyAccess.ts(12,3): error TS2339: Property
1515

1616
a['y'] // Error
1717
~~~~~~
18-
!!! error TS2576: Property 'y' is a static member of type 'A'
18+
!!! error TS2576: Property 'y' is a static member of type 'A'.
1919
a.y // Error
2020
~
21-
!!! error TS2576: Property 'y' is a static member of type 'A'
21+
!!! error TS2576: Property 'y' is a static member of type 'A'.
2222
A._b // Error
2323
~~
2424
!!! error TS2341: Property '_b' is private and only accessible within class 'A'.

tests/baselines/reference/cloduleTest2.errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tests/cases/compiler/cloduleTest2.ts(4,13): error TS2554: Expected 1 arguments, but got 0.
22
tests/cases/compiler/cloduleTest2.ts(10,13): error TS2554: Expected 1 arguments, but got 0.
3-
tests/cases/compiler/cloduleTest2.ts(18,7): error TS2576: Property 'bar' is a static member of type 'm3d'
3+
tests/cases/compiler/cloduleTest2.ts(18,7): error TS2576: Property 'bar' is a static member of type 'm3d'.
44
tests/cases/compiler/cloduleTest2.ts(19,7): error TS2339: Property 'y' does not exist on type 'm3d'.
5-
tests/cases/compiler/cloduleTest2.ts(27,7): error TS2576: Property 'bar' is a static member of type 'm3d'
5+
tests/cases/compiler/cloduleTest2.ts(27,7): error TS2576: Property 'bar' is a static member of type 'm3d'.
66
tests/cases/compiler/cloduleTest2.ts(28,7): error TS2339: Property 'y' does not exist on type 'm3d'.
77
tests/cases/compiler/cloduleTest2.ts(33,9): error TS2554: Expected 1 arguments, but got 0.
88
tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments, but got 0.
@@ -34,7 +34,7 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments,
3434
r.foo();
3535
r.bar(); // error
3636
~~~
37-
!!! error TS2576: Property 'bar' is a static member of type 'm3d'
37+
!!! error TS2576: Property 'bar' is a static member of type 'm3d'.
3838
r.y; // error
3939
~
4040
!!! error TS2339: Property 'y' does not exist on type 'm3d'.
@@ -47,7 +47,7 @@ tests/cases/compiler/cloduleTest2.ts(36,10): error TS2554: Expected 1 arguments,
4747
r.foo();
4848
r.bar(); // error
4949
~~~
50-
!!! error TS2576: Property 'bar' is a static member of type 'm3d'
50+
!!! error TS2576: Property 'bar' is a static member of type 'm3d'.
5151
r.y; // error
5252
~
5353
!!! error TS2339: Property 'y' does not exist on type 'm3d'.

tests/baselines/reference/conditionalOperatorConditionIsObjectType.errors.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(36,1): error TS1345: An expression of type 'void' cannot be tested for truthiness
2-
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(39,1): error TS1345: An expression of type 'void' cannot be tested for truthiness
3-
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(58,20): error TS1345: An expression of type 'void' cannot be tested for truthiness
4-
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(61,23): error TS1345: An expression of type 'void' cannot be tested for truthiness
5-
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(63,32): error TS1345: An expression of type 'void' cannot be tested for truthiness
1+
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(36,1): error TS1345: An expression of type 'void' cannot be tested for truthiness.
2+
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(39,1): error TS1345: An expression of type 'void' cannot be tested for truthiness.
3+
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(58,20): error TS1345: An expression of type 'void' cannot be tested for truthiness.
4+
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(61,23): error TS1345: An expression of type 'void' cannot be tested for truthiness.
5+
tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts(63,32): error TS1345: An expression of type 'void' cannot be tested for truthiness.
66

77

88
==== tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorConditionIsObjectType.ts (5 errors) ====
@@ -43,12 +43,12 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorCondit
4343
//Cond is an object type expression
4444
foo() ? exprAny1 : exprAny2;
4545
~~~~~
46-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
46+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
4747
new Date() ? exprBoolean1 : exprBoolean2;
4848
new C() ? exprNumber1 : exprNumber2;
4949
C.doIt() ? exprString1 : exprString2;
5050
~~~~~~~~
51-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
51+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
5252
condObject.valueOf() ? exprIsObject1 : exprIsObject2;
5353
new Date() ? exprString1 : exprBoolean1; // union
5454

@@ -69,14 +69,14 @@ tests/cases/conformance/expressions/conditonalOperator/conditionalOperatorCondit
6969

7070
var resultIsAny3 = foo() ? exprAny1 : exprAny2;
7171
~~~~~
72-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
72+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
7373
var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2;
7474
var resultIsNumber3 = new C() ? exprNumber1 : exprNumber2;
7575
var resultIsString3 = C.doIt() ? exprString1 : exprString2;
7676
~~~~~~~~
77-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
77+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
7878
var resultIsObject3 = condObject.valueOf() ? exprIsObject1 : exprIsObject2;
7979
var resultIsStringOrBoolean3 = C.doIt() ? exprString1 : exprBoolean1; // union
8080
~~~~~~~~
81-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
81+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
8282

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1326: Dynamic import cannot have type arguments
2-
tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import cannot have type arguments
1+
tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1326: Dynamic import cannot have type arguments.
2+
tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import cannot have type arguments.
33

44

55
==== tests/cases/conformance/dynamicImport/0.ts (0 errors) ====
@@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import c
99
"use strict"
1010
var p1 = import<Promise<any>>("./0"); // error
1111
~~~~~~~~~~~~~~~~~~~~~~~~~~~
12-
!!! error TS1326: Dynamic import cannot have type arguments
12+
!!! error TS1326: Dynamic import cannot have type arguments.
1313
var p2 = import<>("./0"); // error
1414
~~~~~~~~~~~~~~~
15-
!!! error TS1326: Dynamic import cannot have type arguments
15+
!!! error TS1326: Dynamic import cannot have type arguments.

tests/baselines/reference/logicalAndOperatorStrictMode.errors.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(46,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
2-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(47,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
3-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(48,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
4-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(49,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
5-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(50,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
6-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(51,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
7-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(52,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
8-
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(53,12): error TS1345: An expression of type 'void' cannot be tested for truthiness
1+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(46,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
2+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(47,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
3+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(48,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
4+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(49,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
5+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(50,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
6+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(51,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
7+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(52,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
8+
tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts(53,12): error TS1345: An expression of type 'void' cannot be tested for truthiness.
99

1010

1111
==== tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAndOperatorStrictMode.ts (8 errors) ====
@@ -56,28 +56,28 @@ tests/cases/conformance/expressions/binaryOperators/logicalAndOperator/logicalAn
5656

5757
const v1 = v && a;
5858
~
59-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
59+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
6060
const v2 = v && s;
6161
~
62-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
62+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
6363
const v3 = v && x;
6464
~
65-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
65+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
6666
const v4 = v && b;
6767
~
68-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
68+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
6969
const v5 = v && v;
7070
~
71-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
71+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
7272
const v6 = v && u;
7373
~
74-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
74+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
7575
const v7 = v && n;
7676
~
77-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
77+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
7878
const v8 = v && z;
7979
~
80-
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness
80+
!!! error TS1345: An expression of type 'void' cannot be tested for truthiness.
8181

8282
const u1 = u && a;
8383
const u2 = u && s;

0 commit comments

Comments
 (0)