Skip to content

Commit

Permalink
Fix: Improve no-extra-parens error message
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
```
  • Loading branch information
Krinkle committed Aug 8, 2018
1 parent 137140f commit b4df7c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-extra-parens.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
},

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

Expand Down

0 comments on commit b4df7c0

Please sign in to comment.