We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbc8d43 commit 18f4dddCopy full SHA for 18f4ddd
packages/plugin-logical-expressions/lib/simplify/fixture/jsx.js
@@ -2,3 +2,8 @@ const jsx = (
2
<div>{Boolean(info) && <Alert severity="info">{convertToString(info)}</Alert>}
3
</div>
4
);
5
+
6
+const jsx2 = (
7
+ <button disabled={Boolean(error) || disabled}>
8
+ </button>
9
+);
packages/plugin-logical-expressions/lib/simplify/index.js
@@ -5,6 +5,7 @@ const {isSimple, replaceWith} = operator;
export const report = () => 'Simplify logical expression';
export const match = () => ({
+ 'Boolean(__a) || __b': (vars, path) => !path.parentPath.isJSXExpressionContainer(),
'__a(__args) && __b': ({__a, __b}, path) => {
10
if (path.parentPath.isJSXExpressionContainer())
11
return false;
0 commit comments