Disallow new
operators with the Symbol
object
The "extends": "eslint:recommended"
property in a configuration file enables this rule
Symbol
is not intended to be used with the new
operator, but to be called as a function.
This throws a TypeError
exception.
This rule is aimed at preventing the accidental calling of Symbol
with the new
operator.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
This rule should not be used in ES3/5 environments.
This rule was introduced in ESLint v2.0.0-beta.1.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/no-new-symbol