Skip to content

Commit

Permalink
Fix a mistake (#1967)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Nov 17, 2022
1 parent a86bc7c commit 17556d7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion rules/no-negated-condition.js
Expand Up @@ -107,8 +107,9 @@ const create = context => ({
if (
(parent.type === 'ReturnStatement' || parent.type === 'ThrowStatement')
&& parent.argument === node
&& !(isParenthesized(node, sourceCode) && !isParenthesized(test, sourceCode))
&& !isOnSameLine(firstToken, secondToken)
&& !isParenthesized(node, sourceCode)
&& !isParenthesized(test, sourceCode)
) {
yield * addParenthesizesToReturnOrThrowExpression(fixer, parent, sourceCode);
return;
Expand Down
4 changes: 2 additions & 2 deletions test/snapshots/no-negated-condition.mjs.md
Expand Up @@ -259,9 +259,9 @@ Generated by [AVA](https://avajs.dev).
`␊
1 | function a() {␊
2 | return ( (
2 | return (␊
3 | // UnaryExpression argument is parenthesized␊
4 | a) ? c : b);␊
4 | a) ? c : b;␊
5 | }␊
`

Expand Down
Binary file modified test/snapshots/no-negated-condition.mjs.snap
Binary file not shown.

0 comments on commit 17556d7

Please sign in to comment.