1
+
2
+## Input
3
+
4
+```javascript
5
+// @validateSourceLocations
6
+import {useEffect, useCallback} from 'react';
7
+
8
+function Component({prop1, prop2}) {
9
+ const x = prop1 + prop2;
10
+ const y = x * 2;
11
+ const arr = [x, y];
12
+ const obj = {x, y};
13
+ const [a, b] = arr;
14
+ const {x: c, y: d} = obj;
15
+
16
+ useEffect(() => {
17
+ if (a > 10) {
18
+ console.log(a);
19
+ }
20
+ }, [a]);
21
+
22
+ const foo = useCallback(() => {
23
+ return a + b;
24
+ }, [a, b]);
25
+
26
+ function bar() {
27
+ return (c + d) * 2;
28
+ }
29
+
30
+ console.log('Hello, world!');
31
+
32
+ return [y, foo, bar];
33
+}
34
+
35
+```
36
+
37
+
38
+## Error
39
+
40
+```
41
+Found 13 errors:
42
+
43
+Todo: Important source location missing in generated code
44
+
45
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
46
+
47
+error.todo-missing-source-locations.ts:5:8
48
+ 3 |
49
+ 4 | function Component({prop1, prop2}) {
50
+> 5 | const x = prop1 + prop2;
51
+ | ^^^^^^^^^^^^^^^^^
52
+ 6 | const y = x * 2;
53
+ 7 | const arr = [x, y];
54
+ 8 | const obj = {x, y};
55
+
56
+Todo: Important source location missing in generated code
57
+
58
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
59
+
60
+error.todo-missing-source-locations.ts:6:8
61
+ 4 | function Component({prop1, prop2}) {
62
+ 5 | const x = prop1 + prop2;
63
+> 6 | const y = x * 2;
64
+ | ^^^^^^^^^
65
+ 7 | const arr = [x, y];
66
+ 8 | const obj = {x, y};
67
+ 9 | const [a, b] = arr;
68
+
69
+Todo: Important source location missing in generated code
70
+
71
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
72
+
73
+error.todo-missing-source-locations.ts:7:8
74
+ 5 | const x = prop1 + prop2;
75
+ 6 | const y = x * 2;
76
+> 7 | const arr = [x, y];
77
+ | ^^^^^^^^^^^^
78
+ 8 | const obj = {x, y};
79
+ 9 | const [a, b] = arr;
80
+ 10 | const {x: c, y: d} = obj;
81
+
82
+Todo: Important source location missing in generated code
83
+
84
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
85
+
86
+error.todo-missing-source-locations.ts:8:8
87
+ 6 | const y = x * 2;
88
+ 7 | const arr = [x, y];
89
+> 8 | const obj = {x, y};
90
+ | ^^^^^^^^^^^^
91
+ 9 | const [a, b] = arr;
92
+ 10 | const {x: c, y: d} = obj;
93
+ 11 |
94
+
95
+Todo: Important source location missing in generated code
96
+
97
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
98
+
99
+error.todo-missing-source-locations.ts:9:8
100
+ 7 | const arr = [x, y];
101
+ 8 | const obj = {x, y};
102
+> 9 | const [a, b] = arr;
103
+ | ^^^^^^^^^^^^
104
+ 10 | const {x: c, y: d} = obj;
105
+ 11 |
106
+ 12 | useEffect(() => {
107
+
108
+Todo: Important source location missing in generated code
109
+
110
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
111
+
112
+error.todo-missing-source-locations.ts:10:8
113
+ 8 | const obj = {x, y};
114
+ 9 | const [a, b] = arr;
115
+> 10 | const {x: c, y: d} = obj;
116
+ | ^^^^^^^^^^^^^^^^^^
117
+ 11 |
118
+ 12 | useEffect(() => {
119
+ 13 | if (a > 10) {
120
+
121
+Todo: Important source location missing in generated code
122
+
123
+Source location for ExpressionStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
124
+
125
+error.todo-missing-source-locations.ts:12:2
126
+ 10 | const {x: c, y: d} = obj;
127
+ 11 |
128
+> 12 | useEffect(() => {
129
+ | ^^^^^^^^^^^^^^^^^
130
+> 13 | if (a > 10) {
131
+ | ^^^^^^^^^^^^^^^^^
132
+> 14 | console.log(a);
133
+ | ^^^^^^^^^^^^^^^^^
134
+> 15 | }
135
+ | ^^^^^^^^^^^^^^^^^
136
+> 16 | }, [a]);
137
+ | ^^^^^^^^^^^
138
+ 17 |
139
+ 18 | const foo = useCallback(() => {
140
+ 19 | return a + b;
141
+
142
+Todo: Important source location missing in generated code
143
+
144
+Source location for ExpressionStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
145
+
146
+error.todo-missing-source-locations.ts:14:6
147
+ 12 | useEffect(() => {
148
+ 13 | if (a > 10) {
149
+> 14 | console.log(a);
150
+ | ^^^^^^^^^^^^^^^
151
+ 15 | }
152
+ 16 | }, [a]);
153
+ 17 |
154
+
155
+Todo: Important source location missing in generated code
156
+
157
+Source location for VariableDeclarator is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
158
+
159
+error.todo-missing-source-locations.ts:18:8
160
+ 16 | }, [a]);
161
+ 17 |
162
+> 18 | const foo = useCallback(() => {
163
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
164
+> 19 | return a + b;
165
+ | ^^^^^^^^^^^^^^^^^
166
+> 20 | }, [a, b]);
167
+ | ^^^^^^^^^^^^^
168
+ 21 |
169
+ 22 | function bar() {
170
+ 23 | return (c + d) * 2;
171
+
172
+Todo: Important source location missing in generated code
173
+
174
+Source location for ReturnStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
175
+
176
+error.todo-missing-source-locations.ts:19:4
177
+ 17 |
178
+ 18 | const foo = useCallback(() => {
179
+> 19 | return a + b;
180
+ | ^^^^^^^^^^^^^
181
+ 20 | }, [a, b]);
182
+ 21 |
183
+ 22 | function bar() {
184
+
185
+Todo: Important source location missing in generated code
186
+
187
+Source location for ReturnStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
188
+
189
+error.todo-missing-source-locations.ts:23:4
190
+ 21 |
191
+ 22 | function bar() {
192
+> 23 | return (c + d) * 2;
193
+ | ^^^^^^^^^^^^^^^^^^^
194
+ 24 | }
195
+ 25 |
196
+ 26 | console.log('Hello, world!');
197
+
198
+Todo: Important source location missing in generated code
199
+
200
+Source location for ExpressionStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
201
+
202
+error.todo-missing-source-locations.ts:26:2
203
+ 24 | }
204
+ 25 |
205
+> 26 | console.log('Hello, world!');
206
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
207
+ 27 |
208
+ 28 | return [y, foo, bar];
209
+ 29 | }
210
+
211
+Todo: Important source location missing in generated code
212
+
213
+Source location for ReturnStatement is missing in the generated output. This can cause coverage instrumentation to fail to track this code properly, resulting in inaccurate coverage reports..
214
+
215
+error.todo-missing-source-locations.ts:28:2
216
+ 26 | console.log('Hello, world!');
217
+ 27 |
218
+> 28 | return [y, foo, bar];
219
+ | ^^^^^^^^^^^^^^^^^^^^^
220
+ 29 | }
221
+ 30 |
222
+```
223
+
224
+
\ No newline at end of file