Skip to content

Commit 65af685

Browse files
authored
Remove periods from refactor/quickfix messages (#20237)
* Fix #19959 and #19958: Remove un-localizable messages * Update message * Reorder error messages * Fix #15399: remove periods at the end of messages * Accept baselines for error code changes * accept baselines for removed periods * Update diagnostic messages
1 parent 8d7c2a2 commit 65af685

File tree

119 files changed

+163
-162
lines changed

Some content is hidden

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

119 files changed

+163
-162
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,10 @@
22722272
"category": "Error",
22732273
"code": 2718
22742274
},
2275+
"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.": {
2276+
"category": "Error",
2277+
"code": 2719
2278+
},
22752279

22762280
"Import declaration '{0}' is using private name '{1}'.": {
22772281
"category": "Error",
@@ -2719,6 +2723,11 @@
27192723
"category": "Error",
27202724
"code": 5067
27212725
},
2726+
"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.": {
2727+
"category": "Error",
2728+
"code": 5068
2729+
},
2730+
27222731
"Concatenate and emit output to single file.": {
27232732
"category": "Message",
27242733
"code": 6001
@@ -3710,7 +3719,7 @@
37103719
},
37113720
"JSX fragment is not supported when using --jsxFactory": {
37123721
"category": "Error",
3713-
"code":17016
3722+
"code": 17016
37143723
},
37153724

37163725
"Circularity detected while resolving configuration: {0}": {
@@ -3730,104 +3739,95 @@
37303739
"code": 18003
37313740
},
37323741

3733-
"Add missing 'super()' call.": {
3742+
"Add missing 'super()' call": {
37343743
"category": "Message",
37353744
"code": 90001
37363745
},
3737-
"Make 'super()' call the first statement in the constructor.": {
3746+
"Make 'super()' call the first statement in the constructor": {
37383747
"category": "Message",
37393748
"code": 90002
37403749
},
3741-
"Change 'extends' to 'implements'.": {
3750+
"Change 'extends' to 'implements'": {
37423751
"category": "Message",
37433752
"code": 90003
37443753
},
3745-
"Remove declaration for: '{0}'.": {
3754+
"Remove declaration for: '{0}'": {
37463755
"category": "Message",
37473756
"code": 90004
37483757
},
3749-
"Implement interface '{0}'.": {
3758+
"Implement interface '{0}'": {
37503759
"category": "Message",
37513760
"code": 90006
37523761
},
3753-
"Implement inherited abstract class.": {
3762+
"Implement inherited abstract class": {
37543763
"category": "Message",
37553764
"code": 90007
37563765
},
3757-
"Add 'this.' to unresolved variable.": {
3766+
"Add 'this.' to unresolved variable": {
37583767
"category": "Message",
37593768
"code": 90008
37603769
},
3761-
"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.": {
3762-
"category": "Error",
3763-
"code": 90009
3764-
},
3765-
"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.": {
3766-
"category": "Error",
3767-
"code": 90010
3768-
},
3769-
"Import '{0}' from module \"{1}\".": {
3770+
"Import '{0}' from module \"{1}\"": {
37703771
"category": "Message",
37713772
"code": 90013
37723773
},
3773-
"Change '{0}' to '{1}'.": {
3774+
"Change '{0}' to '{1}'": {
37743775
"category": "Message",
37753776
"code": 90014
37763777
},
3777-
"Add '{0}' to existing import declaration from \"{1}\".": {
3778+
"Add '{0}' to existing import declaration from \"{1}\"": {
37783779
"category": "Message",
37793780
"code": 90015
37803781
},
3781-
"Declare property '{0}'.": {
3782+
"Declare property '{0}'": {
37823783
"category": "Message",
37833784
"code": 90016
37843785
},
3785-
"Add index signature for property '{0}'.": {
3786+
"Add index signature for property '{0}'": {
37863787
"category": "Message",
37873788
"code": 90017
37883789
},
3789-
3790-
"Disable checking for this file.": {
3790+
"Disable checking for this file": {
37913791
"category": "Message",
37923792
"code": 90018
37933793
},
3794-
"Ignore this error message.": {
3794+
"Ignore this error message": {
37953795
"category": "Message",
37963796
"code": 90019
37973797
},
3798-
"Initialize property '{0}' in the constructor.": {
3798+
"Initialize property '{0}' in the constructor": {
37993799
"category": "Message",
38003800
"code": 90020
38013801
},
3802-
"Initialize static property '{0}'.": {
3802+
"Initialize static property '{0}'": {
38033803
"category": "Message",
38043804
"code": 90021
38053805
},
3806-
"Change spelling to '{0}'.": {
3806+
"Change spelling to '{0}'": {
38073807
"category": "Message",
38083808
"code": 90022
38093809
},
3810-
"Declare method '{0}'.": {
3810+
"Declare method '{0}'": {
38113811
"category": "Message",
38123812
"code": 90023
38133813
},
3814-
"Declare static method '{0}'.": {
3814+
"Declare static method '{0}'": {
38153815
"category": "Message",
38163816
"code": 90024
38173817
},
3818-
"Prefix '{0}' with an underscore.": {
3818+
"Prefix '{0}' with an underscore": {
38193819
"category": "Message",
38203820
"code": 90025
38213821
},
3822-
"Rewrite as the indexed access type '{0}'.": {
3822+
"Rewrite as the indexed access type '{0}'": {
38233823
"category": "Message",
38243824
"code": 90026
38253825
},
3826-
"Declare static property '{0}'.": {
3826+
"Declare static property '{0}'": {
38273827
"category": "Message",
38283828
"code": 90027
38293829
},
3830-
"Call decorator expression.": {
3830+
"Call decorator expression": {
38313831
"category": "Message",
38323832
"code": 90028
38333833
},
@@ -3871,11 +3871,11 @@
38713871
"category": "Message",
38723872
"code": 95010
38733873
},
3874-
"Infer type of '{0}' from usage.": {
3874+
"Infer type of '{0}' from usage": {
38753875
"category": "Message",
38763876
"code": 95011
38773877
},
3878-
"Infer parameter types from usage.": {
3878+
"Infer parameter types from usage": {
38793879
"category": "Message",
38803880
"code": 95012
38813881
},

tests/baselines/reference/incompatibleAssignmentOfIdenticallyNamedTypes.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): error TS90010: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
1+
tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): error TS2719: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
22

33

44
==== tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts (1 errors) ====
@@ -9,7 +9,7 @@ tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): erro
99
fn() {
1010
this.x = a;
1111
~~~~~~
12-
!!! error TS90010: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
12+
!!! error TS2719: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
1313
}
1414
}
1515

tests/baselines/reference/moduleResolutionWithSymlinks_preserveSymlinks.errors.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/app/app.ts(9,1): error TS90010: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
1+
/app/app.ts(9,1): error TS2719: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
22
Types have separate declarations of a private property 'x'.
33

44

@@ -13,8 +13,8 @@
1313
// Should fail. We no longer resolve any symlinks.
1414
x = new C2();
1515
~
16-
!!! error TS90010: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
17-
!!! error TS90010: Types have separate declarations of a private property 'x'.
16+
!!! error TS2719: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
17+
!!! error TS2719: Types have separate declarations of a private property 'x'.
1818

1919
==== /linked/index.d.ts (0 errors) ====
2020
export { real } from "real";

tests/cases/fourslash/codeFixAddForgottenDecoratorCall01.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
////}
1010

1111
verify.codeFix({
12-
description: "Call decorator expression.",
12+
description: "Call decorator expression",
1313
newRangeContent: `@foo()`
1414
});

tests/cases/fourslash/codeFixAddForgottenThis01.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
////}
99

1010
verify.codeFix({
11-
description: "Add 'this.' to unresolved variable.",
11+
description: "Add 'this.' to unresolved variable",
1212
newRangeContent: `
1313
this.foo = 10;
1414
`

tests/cases/fourslash/codeFixAddForgottenThis02.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
////}
88

99
verify.codeFix({
10-
description: "Add 'this.' to unresolved variable.",
10+
description: "Add 'this.' to unresolved variable",
1111
newRangeContent: "this.foo = 10",
1212
});

tests/cases/fourslash/codeFixAddMissingMember.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////}
88

99
verify.codeFix({
10-
description: "Declare property 'foo'.",
10+
description: "Declare property 'foo'",
1111
index: 0,
1212
// TODO: GH#18445
1313
newFileContent: `class C {

tests/cases/fourslash/codeFixAddMissingMember2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////}
88

99
verify.codeFix({
10-
description: "Add index signature for property 'foo'.",
10+
description: "Add index signature for property 'foo'",
1111
index: 1,
1212
// TODO: GH#18445
1313
newFileContent: `class C {

tests/cases/fourslash/codeFixAddMissingMember3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
////}
88

99
verify.codeFix({
10-
description: "Declare static property 'foo'.",
10+
description: "Declare static property 'foo'",
1111
index: 0,
1212
// TODO: GH#18445
1313
newFileContent: `class C {

tests/cases/fourslash/codeFixAddMissingMember4.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
////}
1414

1515
verify.codeFix({
16-
description: "Initialize property 'foo' in the constructor.",
16+
description: "Initialize property 'foo' in the constructor",
1717
index: 0,
1818
// TODO: GH#18445
1919
newFileContent: `class C {

tests/cases/fourslash/codeFixAddMissingMember5.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
////}
1212

1313
verify.codeFix({
14-
description: "Initialize static property 'foo'.",
14+
description: "Initialize static property 'foo'",
1515
index: 0,
1616
// TODO: GH#18445
1717
newFileContent: `class C {

tests/cases/fourslash/codeFixAddMissingMember6.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
////}
1212

1313
verify.codeFix({
14-
description: "Initialize property 'foo' in the constructor.",
14+
description: "Initialize property 'foo' in the constructor",
1515
index: 0,
1616
// TODO: GH#18445
1717
newFileContent: `class C {

tests/cases/fourslash/codeFixAddMissingMember7.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
////}
1010

1111
verify.codeFix({
12-
description: "Initialize static property 'foo'.",
12+
description: "Initialize static property 'foo'",
1313
index: 2,
1414
// TODO: GH#18445
1515
newFileContent: `class C {

tests/cases/fourslash/codeFixChangeExtendsToImplements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
//// [|/* */ class /* */ C /* */ extends /* */ I|]{}
55

66
verify.codeFix({
7-
description: "Change 'extends' to 'implements'.",
7+
description: "Change 'extends' to 'implements'",
88
newRangeContent: "/* */ class /* */ C /* */ implements /* */ I",
99
});

tests/cases/fourslash/codeFixChangeExtendsToImplementsAbstractModifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//// [|abstract class A extends I1 implements I2|] { }
77

88
verify.codeFix({
9-
description: "Change 'extends' to 'implements'.",
9+
description: "Change 'extends' to 'implements'",
1010
// TODO: GH#18794
1111
newRangeContent: "abstract class A implements I1 , I2",
1212
});

tests/cases/fourslash/codeFixChangeExtendsToImplementsTypeParams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
////[|class C<T extends string , U> extends I<T>|]{}
55

66
verify.codeFix({
7-
description: "Change 'extends' to 'implements'.",
7+
description: "Change 'extends' to 'implements'",
88
newRangeContent: "class C<T extends string , U> implements I<T>",
99
});

tests/cases/fourslash/codeFixChangeExtendsToImplementsWithDecorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//// @sealed
1212
//// [|class A extends I1 implements I2 { }|]
1313
verify.codeFix({
14-
description: "Change 'extends' to 'implements'.",
14+
description: "Change 'extends' to 'implements'",
1515
// TODO: GH#18794
1616
newRangeContent: "class A implements I1 , I2 { }",
1717
});

tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
//// var x: [|?|] = 12;
33

44
verify.codeFix({
5-
description: "Change '?' to 'any'.",
5+
description: "Change '?' to 'any'",
66
newRangeContent: "any",
77
});

tests/cases/fourslash/codeFixChangeJSDocSyntax10.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//// }
55

66
verify.codeFix({
7-
description: "Change 'number?' to 'number | null'.",
7+
description: "Change 'number?' to 'number | null'",
88
errorCode: 8020,
99
index: 0,
1010
newRangeContent: "number | null",

tests/cases/fourslash/codeFixChangeJSDocSyntax11.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//// }
55

66
verify.codeFix({
7-
description: "Change 'string?' to 'string | null | undefined'.",
7+
description: "Change 'string?' to 'string | null | undefined'",
88
errorCode: 8020,
99
index: 1,
1010
newRangeContent: "string | null | undefined",

tests/cases/fourslash/codeFixChangeJSDocSyntax12.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Change '*' to 'any'.",
8+
description: "Change '*' to 'any'",
99
errorCode: 8020,
1010
index: 0,
1111
newRangeContent: "any",

tests/cases/fourslash/codeFixChangeJSDocSyntax13.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
////}
66

77
verify.codeFix({
8-
description: "Change '*' to 'any'.",
8+
description: "Change '*' to 'any'",
99
errorCode: 8020,
1010
index: 0,
1111
newRangeContent: "any",

tests/cases/fourslash/codeFixChangeJSDocSyntax14.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//// var x = 12 as [|number?|];
44

55
verify.codeFix({
6-
description: "Change 'number?' to 'number | null'.",
6+
description: "Change 'number?' to 'number | null'",
77
errorCode: 8020,
88
index: 0,
99
newRangeContent: "number | null",

tests/cases/fourslash/codeFixChangeJSDocSyntax15.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// note: without --strict, number? --> number, not number | null
55
verify.codeFix({
6-
description: "Change 'function(number?): number' to '(arg0: number) => number'.",
6+
description: "Change 'function(number?): number' to '(arg0: number) => number'",
77
errorCode: 8020,
88
index: 0,
99
newRangeContent: "(arg0: number) => number",

tests/cases/fourslash/codeFixChangeJSDocSyntax16.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
//// var f: { [K in keyof number]: [|*|] };
33

44
verify.codeFix({
5-
description: "Change '*' to 'any'.",
5+
description: "Change '*' to 'any'",
66
newRangeContent: "any",
77
});

0 commit comments

Comments
 (0)