# no-array-constructor

Rule `eslint/no-array-constructor`. Disallow `Array` constructors

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 45.5M weekly downloads of presets that enable it
- Trend: +58.0% last quarter
- Rank: #304 by reach, #724 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-array-constructor` | no | safe | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-array-constructor) |
| Oxlint | `no-array-constructor` | no | safe | plugin `eslint`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-array-constructor.html) |
| Biome | `style/useArrayLiterals` | yes | safe | group style, since 1.7.2 | [docs](https://biomejs.dev/linter/rules/use-array-literals/) |

## Code examples

### Incorrect: the rule reports this

```js
Array();

Array(0, 1, 2);

new Array(0, 1, 2);

Array(...args);
```

```ts
new Array();

new Array(0, 1, 2);

Array?.(x, y);

Array?.(0, 1, 2);
```

### Correct: the rule accepts this

```js
Array(500);

new Array(someOtherArray.length);

[0, 1, 2];

const createArray = Array => new Array();
```

```ts
new Array<number>(1, 2, 3);

new Array<Foo>();

Array<number>(1, 2, 3);

Array<Foo>();

Array?.foo();
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-array-constructor": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-array-constructor": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useArrayLiterals": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |
| [Google](https://lintradar.dev/presets/google.md) | ESLint | `eslint-config-google` | 60 | 646.4K | +18.9% |

## Related rules

- [typescript/no-array-constructor](https://lintradar.dev/rules/typescript/no-array-constructor.md): Disallow generic `Array` constructors
- [eslint/dot-notation](https://lintradar.dev/rules/eslint/dot-notation.md): Enforce dot notation whenever possible
- [eslint/default-case-last](https://lintradar.dev/rules/eslint/default-case-last.md): Enforce `default` clauses in `switch` statements to be last
- [eslint/new-cap](https://lintradar.dev/rules/eslint/new-cap.md): Require constructor names to begin with a capital letter
- [eslint/prefer-regex-literals](https://lintradar.dev/rules/eslint/prefer-regex-literals.md): Disallow use of the `RegExp` constructor in favor of regular expression literals
- [eslint/no-unneeded-ternary](https://lintradar.dev/rules/eslint/no-unneeded-ternary.md): Disallow ternary operators when simpler alternatives exist

---

Web page: https://lintradar.dev/rules/eslint/no-array-constructor. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
