no-new-symbol
Disallow new Symbol()
deprecated
Symbol starts with a capital letter but isn't a constructor. new Symbol("id") throws a TypeError when it runs. Call it without new.
ESLint has deprecated this rule. Use no-new-native-nonconstructor instead, which also covers BigInt.
Examples#
example.js1 problem
const id = new SymbolSymbol cannot be called as a constructor.("id");example.jsNo problems
const id = Symbol("id");