tools: enable no-extra-parens in ESLint
authorRich Trott <rtrott@gmail.com>
Tue, 1 Mar 2016 21:27:19 +0000 (13:27 -0800)
committerMyles Borins <mborins@us.ibm.com>
Mon, 21 Mar 2016 20:07:00 +0000 (13:07 -0700)
Enable `no-extra-parens`. This rule restricts the use of parentheses to
only where they are necessary. It is set to be restricted to report only
function expressions.

PR-URL: https://github.com/nodejs/node/pull/5512
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
.eslintrc
test/parallel/test-util-inspect.js

index f2a61ab..fc4eadb 100644 (file)
--- a/.eslintrc
+++ b/.eslintrc
@@ -14,6 +14,7 @@ rules:
   no-empty-character-class: 2
   no-ex-assign: 2
   no-extra-boolean-cast : 2
+  no-extra-parens: [2, "functions"]
   no-extra-semi: 2
   no-func-assign: 2
   no-invalid-regexp: 2
index 106ebf5..618a856 100644 (file)
@@ -505,7 +505,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
 }
 
 {
-  const x = new (function() {});
+  const x = new function() {};
   assert.equal(util.inspect(x), '{}');
 }