From 219329f69af71e491e2d5c35352ed3b989f2306d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 1 Mar 2016 13:27:19 -0800 Subject: [PATCH] tools: enable no-extra-parens in ESLint 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 Reviewed-By: Evan Lucas Reviewed-By: James M Snell --- .eslintrc | 1 + test/parallel/test-util-inspect.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index f2a61ab4134395..fc4eadb9b2cb19 100644 --- 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 diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 106ebf5cf06eae..618a856e195a32 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -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), '{}'); }