-
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(noStringCaseMismatch): ignore escape sequences (#3156)
- Loading branch information
Showing
10 changed files
with
900 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
crates/biome_js_analyze/tests/specs/correctness/noStringCaseMismatch/invalid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
s.toUpperCase() === 'abc'; | ||
s.toUpperCase() == 'abc'; | ||
'abc' === s.toUpperCase(); | ||
s.toLowerCase() === "\u001aX"; | ||
s.toLowerCase() === "\u{001a}X"; | ||
s.toLowerCase() === "\xaaX"; | ||
s.toLowerCase() === "\nX"; | ||
|
||
if (s.toUpperCase() === 'abc' && c == d && e == f) {}; | ||
while (s.toUpperCase() === 'abc' && c == d && e == f) {}; | ||
while (s.toUpperCase() === 'abc') {}; | ||
let b = s.toLowerCase() === `eFg`;; | ||
do {} while (s.toLowerCase() === 'ABC');; | ||
for (; s.toLowerCase() === 'ABC'; ) {}; | ||
|
||
switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } | ||
|
||
for (; s['toLowerCase']() === 'ABC'; ) {} | ||
for (; s[`toUpperCase`]() === 'abc'; ) {} | ||
|
||
switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } |
Oops, something went wrong.