> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-new-object

[Added in v0.4.2](https://github.com/web-infra-dev/rslint/releases/tag/v0.4.2)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-new-object': 'error',
    },
  },
]);
```

## Rule Details

Disallow `Object` constructors. The object literal notation `{}` is preferable.

Examples of **incorrect** code for this rule:

```javascript
var myObject = new Object();

new Object();
```

Examples of **correct** code for this rule:

```javascript
var myObject = {};

var myObject = new CustomObject();

var foo = new foo.Object();
```

## Original Documentation

- [ESLint: no-new-object](https://eslint.org/docs/latest/rules/no-new-object)
- [Source code](https://github.com/eslint/eslint/blob/v10.8.1/lib/rules/no-new-object.js)
