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, and this page is available as Markdown at https://rslint.rs/rules/eslint/no-new-object.md.
close

no-new-object

Added in v0.4.2

Configuration

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:

var myObject = new Object();

new Object();

Examples of correct code for this rule:

var myObject = {};

var myObject = new CustomObject();

var foo = new foo.Object();

Original Documentation