-
-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(useArrayLiterals): check all expressions and add a fix (#4416)
- Loading branch information
Showing
7 changed files
with
457 additions
and
107 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
31 changes: 25 additions & 6 deletions
31
crates/biome_js_analyze/tests/specs/correctness/useArrayLiterals/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 |
---|---|---|
@@ -1,11 +1,30 @@ | ||
Array(); | ||
var xs = Array(); | ||
|
||
Array(0, 1, 2); | ||
var xs = Array(0, 1, 2); | ||
|
||
Array(...args); | ||
var xs = Array(...args); | ||
|
||
new Array(); | ||
var xs = new Array; | ||
|
||
new Array(0, 1, 2); | ||
var xs = new Array(); | ||
|
||
new Array(...args); | ||
var xs = new Array(0, 1, 2); | ||
|
||
var xs = new Array(...args); | ||
|
||
var xs = /**A*/ new /**B*/ Array /**C*/ ( /**D*/ 0 /**E*/, /**F*/ 1 /**G*/) /**H*/; | ||
|
||
var xs = (Array)( | ||
/* foo */ a, | ||
b = c() // bar | ||
); | ||
|
||
var xs = Array?.(); | ||
|
||
// ASI | ||
foo | ||
new Array | ||
|
||
var xs = globalThis.Array(); | ||
|
||
var xs = window.Array(); |
Oops, something went wrong.