From f3d8454cc8d51168f901d6f5c5055be6fe5e391a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 11 Aug 2018 16:47:43 +0100 Subject: [PATCH] Update: Improve no-extra-parens error message (#10748) When I encountered this error, it was not unclear to me what the problem was or what alternative would be preferred. The input was: ```js return ( { foo: 1, bar: 2 }[ key ] || 0 ); ``` Receiving the following in Atom's footer: ``` eslint (0|4), Gratuitous parentheses around expression., Line 165, Column 17 ``` Using the phrase "Unnecessary" instead, which also matches the error message used by other ESLint rules. --- lib/rules/no-extra-parens.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/no-extra-parens.js b/lib/rules/no-extra-parens.js index 814cf0faf04..47c58946cf1 100644 --- a/lib/rules/no-extra-parens.js +++ b/lib/rules/no-extra-parens.js @@ -58,7 +58,7 @@ module.exports = { }, messages: { - unexpected: "Gratuitous parentheses around expression." + unexpected: "Unnecessary parentheses around expression." } },