Skip to content

Commit 66ea32d

Browse files
committed
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 <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9091ccd commit 66ea32d

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
@@ -640,7 +640,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
640640
}
641641

642642
{
643-
const x = new (function() {});
643+
const x = new function() {};
644644
assert.equal(util.inspect(x), '{}');
645645
}
646646

0 commit comments

Comments
 (0)