---
source: crates/oxc_linter/src/tester.rs
expression: new_for_builtins
---
  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Object()` instead of `Object()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const object = (Object)();
   ·                ──────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Symbol()` instead of `new Symbol()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const symbol = new (Symbol)("");
   ·                ────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Symbol()` instead of `new Symbol()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const symbol = new /* comment */ Symbol("");
   ·                ────────────────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Symbol()` instead of `new Symbol()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const symbol = new Symbol;
   ·                ──────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `String()` instead of `new String()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ new globalThis.String()
   · ───────────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `String()` instead of `new String()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ new global.String()
   · ───────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `String()` instead of `new String()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ new self.String()
   · ─────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `String()` instead of `new String()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ new window.String()
   · ───────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ globalThis.Array()
   · ──────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ global.Array()
   · ──────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ self.Array()
   · ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ window.Array()
   · ──────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ globalThis.Array()
   · ──────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Object()` instead of `Object()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Object()
   ·             ────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Array()
   ·             ───────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new ArrayBuffer()` instead of `ArrayBuffer()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = ArrayBuffer()
   ·             ─────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new BigInt64Array()` instead of `BigInt64Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = BigInt64Array()
   ·             ───────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new BigUint64Array()` instead of `BigUint64Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = BigUint64Array()
   ·             ────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new DataView()` instead of `DataView()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = DataView()
   ·             ──────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Date()` instead of `Date()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Date()
   ·             ──────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Error()` instead of `Error()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Error()
   ·             ───────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Error()` instead of `Error()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Error('Foo bar')
   ·             ────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Float32Array()` instead of `Float32Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Float32Array()
   ·             ──────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Float64Array()` instead of `Float64Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Float64Array()
   ·             ──────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Function()` instead of `Function()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Function()
   ·             ──────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Int8Array()` instead of `Int8Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Int8Array()
   ·             ───────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Int16Array()` instead of `Int16Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Int16Array()
   ·             ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Int32Array()` instead of `Int32Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Int32Array()
   ·             ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Map()` instead of `Map()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = (( Map ))()
   ·             ───────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Map()` instead of `Map()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Map([['foo', 'bar'], ['unicorn', 'rainbow']])
   ·             ─────────────────────────────────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new WeakMap()` instead of `WeakMap()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = WeakMap()
   ·             ─────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Set()` instead of `Set()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Set()
   ·             ─────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new WeakSet()` instead of `WeakSet()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = WeakSet()
   ·             ─────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Promise()` instead of `Promise()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Promise()
   ·             ─────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new RegExp()` instead of `RegExp()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = RegExp()
   ·             ────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Uint8Array()` instead of `Uint8Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Uint8Array()
   ·             ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Uint16Array()` instead of `Uint16Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Uint16Array()
   ·             ─────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Uint32Array()` instead of `Uint32Array()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Uint32Array()
   ·             ─────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Uint8ClampedArray()` instead of `Uint8ClampedArray()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = Uint8ClampedArray()
   ·             ───────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `BigInt()` instead of `new BigInt()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = new BigInt(123)
   ·             ───────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Boolean()` instead of `new Boolean()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = new Boolean()
   ·             ─────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Number()` instead of `new Number()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = new Number()
   ·             ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Number()` instead of `new Number()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = new Number('123')
   ·             ─────────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `String()` instead of `new String()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = new String()
   ·             ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `Symbol()` instead of `new Symbol()`
   ╭─[new_for_builtins.tsx:1:1]
 1 │ const foo = new Symbol()
   ·             ────────────
   ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Array()` instead of `Array()`
    ╭─[new_for_builtins.tsx:12:1]
 12 │                 }
 13 │                 return Array()
    ·                        ───────
 14 │             }
    ╰────

  ⚠ eslint-plugin-unicorn(new-for-builtins): Use `new Map()` instead of `Map()`
    ╭─[new_for_builtins.tsx:18:1]
 18 │                 }
 19 │                 return Map()
    ·                        ─────
 20 │             }
    ╰────


