useArrayLiterals (since v1.7.2)
Diagnostic Category: lint/correctness/useArrayLiterals
Sources:
- Same as: 
no-array-constructor 
Disallow Array constructors.
Use of the Array constructor to construct a new array is generally discouraged in favor of array literal notation because of the single-argument pitfall and because the Array global may be redefined. The exception is when the Array constructor intentionally creates sparse arrays of a specified size by giving the constructor a single numeric argument.
Examples
Section titled ExamplesInvalid
Section titled InvalidArray();code-block.js:1:1 lint/correctness/useArrayLiterals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ⚠ Don't use Array constructors.
  
  > 1 │ Array();
      │ ^^^^^^^^
    2 │ 
  
  ℹ Use of the Array constructor is not allowed except creating sparse arrays of a specified size by giving a single numeric argument.
  
  ℹ The array literal notation [] is preferable.
  
Array(0, 1, 2);code-block.js:1:1 lint/correctness/useArrayLiterals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ⚠ Don't use Array constructors.
  
  > 1 │ Array(0, 1, 2);
      │ ^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Use of the Array constructor is not allowed except creating sparse arrays of a specified size by giving a single numeric argument.
  
  ℹ The array literal notation [] is preferable.
  
new Array(0, 1, 2);code-block.js:1:1 lint/correctness/useArrayLiterals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ⚠ Don't use Array constructors.
  
  > 1 │ new Array(0, 1, 2);
      │ ^^^^^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Use of the Array constructor is not allowed except creating sparse arrays of a specified size by giving a single numeric argument.
  
  ℹ The array literal notation [] is preferable.
  
Array(...args);code-block.js:1:1 lint/correctness/useArrayLiterals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ⚠ Don't use Array constructors.
  
  > 1 │ Array(...args);
      │ ^^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Use of the Array constructor is not allowed except creating sparse arrays of a specified size by giving a single numeric argument.
  
  ℹ The array literal notation [] is preferable.
  
Valid
Section titled ValidArray(500);[0, 1, 2];