> 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-object-constructor

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


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

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

## Rule Details

Use of the `Object` constructor to construct a new empty object is generally discouraged in favor of object literal notation because of conciseness and because the `Object` global may be redefined. The exception is when the `Object` constructor is used to intentionally wrap a specified value which is passed as an argument.

This rule disallows calling the `Object` constructor without an argument.

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

```javascript
Object();

new Object();
```

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

```javascript
Object("foo");

const obj = { a: 1, b: 2 };

const isObject = (value) => value === Object(value);

const createObject = (Object) => new Object();
```

## Differences from ESLint

- When the object constructor call is fixed onto a new line right after certain TypeScript-only constructs — a type alias (`type T = Foo`), an ambient or overload function declaration (`declare function foo()`), an import-equals declaration (`import Foo = Bar`), or an `as`/`satisfies` type cast — rslint's suggested fix inserts a leading `;` that ESLint omits (e.g. `type T = Foo\n;({})` instead of `type T = Foo\n({})`). The extra semicolon never changes the resulting code's behavior.

## Original Documentation

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