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-native-nonconstructor.md.
close

no-new-native-nonconstructor

Added in v0.6.5

Configuration

PresetConfigured Value
✅ js.configs.recommended"error"
rslint.config.ts
import { defineConfig, js } from '@rslint/core';

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

Rule Details

Disallows using the new operator with native global functions that are not constructors.

Examples of incorrect code for this rule:

const foo = new Symbol('foo');
const bar = new BigInt(9007199254740991);

Examples of correct code for this rule:

const foo = Symbol('foo');
const bar = BigInt(9007199254740991);

function baz(Symbol) {
  const qux = new Symbol('baz');
}

const SymbolCtor = Symbol;
new SymbolCtor();

Original Documentation