Skip to content

Commit 94118b6

Browse files
committed
Properly check if a codefix is needed
1 parent 70fee3f commit 94118b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/codefixes/addMissingConstInForLoop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace ts.codefix {
66
errorCodes,
77
getCodeActions: (context) => {
88
const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start));
9-
if (changes) {
9+
if (changes.length > 0) {
1010
return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_to_unresolved_variable, fixId, Diagnostics.Add_const_to_all_unresolved_variables)];
1111
}
1212
},

0 commit comments

Comments
 (0)