Skip to content

Commit 131ed49

Browse files
TrottMyles Borins
authored andcommitted
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: #5512 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1afab6a commit 131ed49

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ rules:
1414
no-empty-character-class: 2
1515
no-ex-assign: 2
1616
no-extra-boolean-cast : 2
17+
no-extra-parens: [2, "functions"]
1718
no-extra-semi: 2
1819
no-func-assign: 2
1920
no-invalid-regexp: 2

test/parallel/test-util-inspect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
505505
}
506506

507507
{
508-
const x = new (function() {});
508+
const x = new function() {};
509509
assert.equal(util.inspect(x), '{}');
510510
}
511511

0 commit comments

Comments
 (0)