From ce3e5c9a5fcf17961c3595a984aaa7dbb035ce98 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. --- .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 57833d65f5bb95..115695db6a6487 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -640,7 +640,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), '{}'); }