Skip to content

Commit

Permalink
Update: Improve no-extra-parens error message (#10748)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Krinkle authored and platinumazure committed Aug 11, 2018
1 parent 562a03f commit f3d8454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-extra-parens.js
Expand Up @@ -58,7 +58,7 @@ module.exports = {
},

messages: {
unexpected: "Gratuitous parentheses around expression."
unexpected: "Unnecessary parentheses around expression."
}
},

Expand Down

0 comments on commit f3d8454

Please sign in to comment.