# Source: https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-new-native-nonconstructor.md

---
url: /docs/guide/usage/linter/rules/eslint/no-new-native-nonconstructor.md
---

### What it does

Disallow `new` operators with global non-constructor functions (`Symbol`, `BigInt`).

This rule can be disabled for TypeScript code, as the TypeScript compiler
enforces this check.

### Why is this bad?

Both `new Symbol` and `new BigInt` throw a type error because they are
functions and not classes. It is easy to make this mistake by assuming
the uppercase letters indicate classes.

### Examples

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

```js
// throws a TypeError
let foo = new Symbol("foo");

// throws a TypeError
let result = new BigInt(9007199254740991);
```

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

```js
let foo = Symbol("foo");

let result = BigInt(9007199254740991);
```

## How to use

To **enable** this rule using the config file or in the CLI, you can use:

::: code-group

```json [Config (.oxlintrc.json)]
{
  "rules": {
    "no-new-native-nonconstructor": "error"
  }
}
```

```bash [CLI]
oxlint --deny no-new-native-nonconstructor
```

:::

## References

* Rule Source