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:
Diana Whitten 2015-08-27 16:36:47 -07:00
parent 2c5d458d93
commit 502b448977
1 changed files with 1 additions and 1 deletions

View File

@ -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