Skip to content

Commit c5a4d89

Browse files
committed
Shift diagnostic messages and update references
This is a non-functional change. Signed-off-by: Hana Joo <hanajoo@google.com>
1 parent 620cea5 commit c5a4d89

89 files changed

Lines changed: 699 additions & 677 deletions

File tree

Some content is hidden

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

src/compiler/diagnosticMessages.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6818,58 +6818,62 @@
68186818
"category": "Error",
68196819
"code": 9024
68206820
},
6821-
"Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.": {
6821+
"Declaration emit for this expression requires adding a path reference directive to '{0}' with --isolatedDeclarations.": {
68226822
"category": "Error",
68236823
"code": 9025
68246824
},
6825-
"Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations.": {
6825+
"Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations.": {
68266826
"category": "Error",
68276827
"code": 9026
68286828
},
6829-
"Add a type annotation to the variable {0}.": {
6829+
"Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations.": {
68306830
"category": "Error",
68316831
"code": 9027
68326832
},
6833-
"Add a type annotation to the parameter {0}.": {
6833+
"Add a type annotation to the variable {0}.": {
68346834
"category": "Error",
68356835
"code": 9028
68366836
},
6837-
"Add a type annotation to the property {0}.": {
6837+
"Add a type annotation to the parameter {0}.": {
68386838
"category": "Error",
68396839
"code": 9029
68406840
},
6841-
"Add a return type to the function expression.": {
6841+
"Add a type annotation to the property {0}.": {
68426842
"category": "Error",
68436843
"code": 9030
68446844
},
6845-
"Add a return type to the function declaration.": {
6845+
"Add a return type to the function expression.": {
68466846
"category": "Error",
68476847
"code": 9031
68486848
},
6849-
"Add a return type to the get accessor declaration.": {
6849+
"Add a return type to the function declaration.": {
68506850
"category": "Error",
68516851
"code": 9032
68526852
},
6853-
"Add a type to parameter of the set accessor declaration.": {
6853+
"Add a return type to the get accessor declaration.": {
68546854
"category": "Error",
68556855
"code": 9033
68566856
},
6857-
"Add a return type to the method": {
6857+
"Add a type to parameter of the set accessor declaration.": {
68586858
"category": "Error",
68596859
"code": 9034
68606860
},
6861-
"Add a type assertion to this expression to make type type explicit.": {
6861+
"Add a return type to the method": {
68626862
"category": "Error",
68636863
"code": 9035
68646864
},
6865-
"Move the expression in default export to a variable and add a type annotation to it.": {
6865+
"Add a type assertion to this expression to make type type explicit.": {
68666866
"category": "Error",
68676867
"code": 9036
68686868
},
6869-
"Default exports can't be inferred with --isolatedDeclarations.": {
6869+
"Move the expression in default export to a variable and add a type annotation to it.": {
68706870
"category": "Error",
68716871
"code": 9037
68726872
},
6873+
"Default exports can't be inferred with --isolatedDeclarations.": {
6874+
"category": "Error",
6875+
"code": 9038
6876+
},
68736877
"JSX attributes must only be assigned a non-empty 'expression'.": {
68746878
"category": "Error",
68756879
"code": 17000

tests/baselines/reference/computedPropertiesNarrowed.errors.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ computedPropertiesNarrowed.ts(47,5): error TS9014: Computed properties must be n
1515
[x]: 1 // error narrow type !== declared type
1616
~~~
1717
!!! error TS9014: Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations.
18-
!!! related TS9027 computedPropertiesNarrowed.ts:4:12: Add a type annotation to the variable o.
18+
!!! related TS9028 computedPropertiesNarrowed.ts:4:12: Add a type annotation to the variable o.
1919
}
2020

2121

@@ -31,24 +31,24 @@ computedPropertiesNarrowed.ts(47,5): error TS9014: Computed properties must be n
3131
export let o32 = { [1-1]: 1 } // error number
3232
~~~~~
3333
!!! error TS9014: Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations.
34-
!!! related TS9027 computedPropertiesNarrowed.ts:18:12: Add a type annotation to the variable o32.
34+
!!! related TS9028 computedPropertiesNarrowed.ts:18:12: Add a type annotation to the variable o32.
3535

3636
let u = Symbol();
3737
~~~~~~~~
3838
!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
39-
!!! related TS9027 computedPropertiesNarrowed.ts:20:5: Add a type annotation to the variable u.
39+
!!! related TS9028 computedPropertiesNarrowed.ts:20:5: Add a type annotation to the variable u.
4040
export let o4 = {
4141
[u]: 1 // Should error, nut a unique symbol
4242
~~~
4343
!!! error TS9014: Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations.
44-
!!! related TS9027 computedPropertiesNarrowed.ts:21:12: Add a type annotation to the variable o4.
44+
!!! related TS9028 computedPropertiesNarrowed.ts:21:12: Add a type annotation to the variable o4.
4545
}
4646

4747
export let o5 ={
4848
[Symbol()]: 1 // Should error
4949
~~~~~~~~~~
5050
!!! error TS9014: Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations.
51-
!!! related TS9027 computedPropertiesNarrowed.ts:25:12: Add a type annotation to the variable o5.
51+
!!! related TS9028 computedPropertiesNarrowed.ts:25:12: Add a type annotation to the variable o5.
5252
}
5353

5454
const uu: unique symbol = Symbol();
@@ -62,7 +62,7 @@ computedPropertiesNarrowed.ts(47,5): error TS9014: Computed properties must be n
6262
[foo()]: 1 // Should error
6363
~~~~~~~
6464
!!! error TS9014: Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations.
65-
!!! related TS9027 computedPropertiesNarrowed.ts:36:12: Add a type annotation to the variable o7.
65+
!!! related TS9028 computedPropertiesNarrowed.ts:36:12: Add a type annotation to the variable o7.
6666
};
6767

6868
let E = { A: 1 } as const
@@ -75,6 +75,6 @@ computedPropertiesNarrowed.ts(47,5): error TS9014: Computed properties must be n
7575
[ns().v]: 1
7676
~~~~~~~~
7777
!!! error TS9014: Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations.
78-
!!! related TS9027 computedPropertiesNarrowed.ts:46:14: Add a type annotation to the variable o9.
78+
!!! related TS9028 computedPropertiesNarrowed.ts:46:14: Add a type annotation to the variable o9.
7979
}
8080

tests/baselines/reference/isolated-declarations/auto-fixed/diff/arrayFakeFlatNoCrashInferenceDeclarations.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
!!! error TS5088: The inferred type of 'foo' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary.
3838
+ ~~~
3939
+!!! error TS9007: Function must have an explicit return type annotation with --isolatedDeclarations.
40-
+!!! related TS9031 arrayFakeFlatNoCrashInferenceDeclarations.ts:13:10: Add a return type to the function declaration.
40+
+!!! related TS9032 arrayFakeFlatNoCrashInferenceDeclarations.ts:13:10: Add a return type to the function declaration.
4141
return flat(arr, depth);
4242
}
4343
\ No newline at end of file

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitCommonJsModuleReferencedType.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
!!! error TS2742: The inferred type of 'x' cannot be named without a reference to 'foo/node_modules/nested'. This is likely not portable. A type annotation is necessary.
3636
+ ~~~~~
3737
+!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
38-
+!!! related TS9027 r/entry.ts:3:14: Add a type annotation to the variable x.
38+
+!!! related TS9028 r/entry.ts:3:14: Add a type annotation to the variable x.
3939
export const y: RootProps = bar();
4040

4141
\ No newline at end of file

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitForGlobalishSpecifierSymlink.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
+ export const a = getA();
5151
+ ~~~~~~
5252
+!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
53-
+!!! related TS9027 /p1/index.ts:4:14: Add a type annotation to the variable a.
53+
+!!! related TS9028 /p1/index.ts:4:14: Add a type annotation to the variable a.
5454
+==== /p2/index.d.ts (0 errors) ====
5555
+ export const a: import("typescript-fsa").A;
5656
+

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitForGlobalishSpecifierSymlink2.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
+ export const a = getA();
3939
+ ~~~~~~
4040
+!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
41-
+!!! related TS9027 /p1/index.ts:4:14: Add a type annotation to the variable a.
41+
+!!! related TS9028 /p1/index.ts:4:14: Add a type annotation to the variable a.
4242
+==== /p2/index.d.ts (0 errors) ====
4343
+ export const a: import("typescript-fsa").A;
4444
+

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitObjectAssignedDefaultExport.d.ts.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/// [Errors] ////
1818

1919
index.ts(7,1): error TS2742: The inferred type of 'default' cannot be named without a reference to 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary.
20-
+index.ts(7,16): error TS9037: Default exports can't be inferred with --isolatedDeclarations.
20+
+index.ts(7,16): error TS9038: Default exports can't be inferred with --isolatedDeclarations.
2121

2222

2323
==== node_modules/styled-components/node_modules/hoist-non-react-statics/index.d.ts (0 errors) ====
@@ -48,7 +48,7 @@
4848
~~~
4949
!!! error TS2742: The inferred type of 'default' cannot be named without a reference to 'styled-components/node_modules/hoist-non-react-statics'. This is likely not portable. A type annotation is necessary.
5050
+ ~~
51-
+!!! error TS9037: Default exports can't be inferred with --isolatedDeclarations.
52-
+!!! related TS9036 index.ts:7:1: Move the expression in default export to a variable and add a type annotation to it.
51+
+!!! error TS9038: Default exports can't be inferred with --isolatedDeclarations.
52+
+!!! related TS9037 index.ts:7:1: Move the expression in default export to a variable and add a type annotation to it.
5353

5454
\ No newline at end of file

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitReexportedSymlinkReference.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
+ export const ADMIN = MetadataAccessor.create<boolean>('1');
3030
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3131
+!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
32-
+!!! related TS9027 monorepo/pkg3/src/keys.ts:3:14: Add a type annotation to the variable ADMIN.
32+
+!!! related TS9028 monorepo/pkg3/src/keys.ts:3:14: Add a type annotation to the variable ADMIN.
3333
+==== monorepo/pkg1/dist/index.d.ts (0 errors) ====
3434
+ export * from './types';
3535
+==== monorepo/pkg1/dist/types.d.ts (0 errors) ====

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitReexportedSymlinkReference2.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
+ export const ADMIN = MetadataAccessor.create<boolean>('1');
3030
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3131
+!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
32-
+!!! related TS9027 monorepo/pkg3/src/keys.ts:3:14: Add a type annotation to the variable ADMIN.
32+
+!!! related TS9028 monorepo/pkg3/src/keys.ts:3:14: Add a type annotation to the variable ADMIN.
3333
+==== monorepo/pkg1/dist/index.d.ts (0 errors) ====
3434
+ export * from './types';
3535
+==== monorepo/pkg1/dist/types.d.ts (0 errors) ====

tests/baselines/reference/isolated-declarations/auto-fixed/diff/declarationEmitReexportedSymlinkReference3.d.ts.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
!!! error TS2742: The inferred type of 'ADMIN' cannot be named without a reference to '../../pkg2/node_modules/@raymondfeng/pkg1/dist'. This is likely not portable. A type annotation is necessary.
3131
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3232
+!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
33-
+!!! related TS9027 monorepo/pkg3/src/keys.ts:3:14: Add a type annotation to the variable ADMIN.
33+
+!!! related TS9028 monorepo/pkg3/src/keys.ts:3:14: Add a type annotation to the variable ADMIN.
3434
==== monorepo/pkg1/dist/index.d.ts (0 errors) ====
3535
export * from './types';
3636
==== monorepo/pkg1/dist/types.d.ts (0 errors) ====

0 commit comments

Comments
 (0)