Enabled no-new
The goal of using new with a constructor is typically to create an object of a particular type and store that object in a variable, such as: var person = new Person(); It's less common to use new and not store the result, such as: new Person(); In this case, the created object is thrown away because its reference isn't stored anywhere, and in many cases, this means that the constructor should be replaced with a function that doesn't require new to be used. Change-Id: I2afcd3014aa1c1ea05146ba539efd18704a46d2c
This commit is contained in:
parent
2c5d458d93
commit
502b448977
|
@ -308,7 +308,7 @@ rules:
|
|||
|
||||
# Disallow use of new operator when not part of the assignment or comparison
|
||||
# http://eslint.org/docs/rules/no-new
|
||||
no-new: 0 # TODO(krotscheck): Discuss & Activate
|
||||
no-new: 2
|
||||
|
||||
# Disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
|
||||
# http://eslint.org/docs/rules/no-octal-escape
|
||||
|
|
Loading…
Reference in New Issue