Skip to content

Commit 1d52943

Browse files
committed
update code comments
1 parent bf4c814 commit 1d52943

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/biome_js_analyze/src/lint/suspicious/no_useless_escape_in_string.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ fn next_useless_escape(str: &str, quote: u8) -> Option<usize> {
179179
return Some(i);
180180
}
181181
}
182-
// In template literals, $\{ is a valid escape for producing a literal ${
182+
// Check the \{ sequence. This \ is only a valid escape in template literals
183+
// when the preceding character is $ (i.e., `$\{`)
183184
b'{' => {
185+
// Check for template literals and look backward for $
184186
if !(quote == b'`' && i > 0 && str.as_bytes()[i - 1] == b'$') {
185187
return Some(i);
186188
}

0 commit comments

Comments
 (0)