Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .changeset/curvy-worlds-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
'@biomejs/biome': patch
---

Related to [#8491](https://github.com/biomejs/biome/issues/8491): Fixed the issue with false positive errors for safe boolean expressions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR doesn't close the "related" bug, there's no need to add it to the changeset

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR do fix the issue

function MyComponent() {
  const someCondition = !!x;

  return (
    <div>
      {someCondition && "hello"}
      {!!someCondition && "hello"}
    </div>
  )
}

However, it still doesn't addresses the fixes for #8491 (comment)

I couldn't find the perfect way to describe the fixes, hence "Related"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to just mention what this patch fixes. If you want to highlight the issue, which is good, I suggest finding a different wording e.g. "There are still pending fixes. Head to #xxx for more details". "Related #xxxx` doesn't seem useful for our users

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


This new change will check for safe boolean expressions in variable declarations.

For example,

Valid:

```jsx
let isOne = 1;
let isPositiveNumber = number > 0;

return <div> {isOne && "One } { isPositiveNumber && "Is positive" }</div>
Comment thread
dibashthapa marked this conversation as resolved.
Outdated
Comment thread
ematipico marked this conversation as resolved.
Outdated
```
Comment thread
dibashthapa marked this conversation as resolved.

Invalid:

```jsx
let emptyStr = '';
let isZero = 0;

return (
<div>
{emptyStr && 'Empty String'} {isZero && 'Number is zero'}{' '}
</div>
);
```
91 changes: 57 additions & 34 deletions crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ use biome_analyze::{
Rule, RuleDiagnostic, RuleDomain, RuleSource, context::RuleContext, declare_lint_rule,
};
use biome_console::markup;
use biome_js_semantic::SemanticModel;
use biome_js_syntax::{
AnyJsExpression, JsConditionalExpression, JsLogicalExpression, JsLogicalOperator, JsSyntaxNode,
JsxExpressionChild, JsxTagExpression, binding_ext::AnyJsBindingDeclaration,
jsx_ext::AnyJsxElement,
AnyJsExpression, AnyJsLiteralExpression, JsConditionalExpression, JsLogicalExpression,
JsLogicalOperator, JsReferenceIdentifier, JsSyntaxNode, JsxExpressionChild, JsxTagExpression,
binding_ext::AnyJsBindingDeclaration, jsx_ext::AnyJsxElement,
};
use biome_rowan::{AstNode, declare_node_union};
use biome_rule_options::no_leaked_render::NoLeakedRenderOptions;
Expand Down Expand Up @@ -98,7 +99,7 @@ declare_lint_rule! {

impl Rule for NoLeakedRender {
type Query = Semantic<NoLeakedRenderQuery>;
type State = bool;
type State = ();
type Signals = Option<Self::State>;
type Options = NoLeakedRenderOptions;

Expand Down Expand Up @@ -165,38 +166,46 @@ impl Rule for NoLeakedRender {

if let AnyJsExpression::JsIdentifierExpression(ident) = &left {
let name = ident.name().ok()?;

// Use the semantic model to resolve the variable binding and check
// if it's initialized with a boolean literal. This allows us to
// if it's initialized with safe expressions. This allows us to
// handle cases like:
// let isOpen = false; // This is safe
// let isError = errorCount > 0; // This is safe
// let isEqual = a === b; // This is safe
// let emptyStr = ''; // This is unsafe
// return <div>{isOpen && <Content />}</div>; // This should pass
if let Some(binding) = model.binding(&name)
&& binding
.tree()
.declaration()
.and_then(|declaration| {
if let AnyJsBindingDeclaration::JsVariableDeclarator(declarator) =
declaration
{
Some(declarator)
} else {
None
}
})
.and_then(|declarator| declarator.initializer())
.and_then(|initializer| initializer.expression().ok())
.and_then(|expr| {
if let AnyJsExpression::AnyJsLiteralExpression(literal) = expr {
Some(literal)
} else {
None
}
})
.and_then(|literal| literal.value_token().ok())
.is_some_and(|token| matches!(token.text_trimmed(), "true" | "false"))
{
return None;
// return <div> {isError && <Error />}</div>; // This should pass
// return <div> {isEqual && <Equal />}</div>; // This should pass
// return <div> {emptyStr && <Empty />}</div>; // This should fail

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not actually, this was supposed to be comment for future contributors, so that it makes sense what the code is doing. Maybe i added more noise by doing that

@ematipico should i remove ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, it wasn't clear. I would move the phrasing first, the example afterwards


if let Some(variable) = find_variable(model, &name) {
match variable {
AnyJsExpression::AnyJsLiteralExpression(expr) => {
match expr {
AnyJsLiteralExpression::JsStringLiteralExpression(str) => {
if str.inner_string_text().ok()?.text().is_empty() {
return Some(());
}
return None;
}
AnyJsLiteralExpression::JsNullLiteralExpression(_) => {
return Some(());
}
AnyJsLiteralExpression::JsNumberLiteralExpression(num) => {
let value = num.value_token().ok()?;
if value.text_trimmed() == "0" {
return Some(());
}
return None;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}
_ => return None,
};
}
AnyJsExpression::JsUnaryExpression(_)
| AnyJsExpression::JsBinaryExpression(_)
| AnyJsExpression::JsCallExpression(_) => return None,
_ => {}
}
}
}
Comment on lines 159 to 179

@coderabbitai coderabbitai Bot Dec 22, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Check if the file exists and view the relevant lines
echo "=== Checking file and code at lines 167-210 ==="
if [ -f "crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs" ]; then
    sed -n '167,210p' crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs
else
    echo "File not found at expected location"
    find . -name "*no_leaked_render*" -type f 2>/dev/null | head -5
fi

echo ""
echo "=== Checking BigInt test cases ==="
find crates/biome_js_analyze/tests -name "*noLeakedRender*" -o -name "*no_leaked_render*" 2>/dev/null | head -5

echo ""
echo "=== Searching for BigInt 0n in test specs ==="
rg "0n" crates/biome_js_analyze/tests/specs/nursery/ 2>/dev/null | grep -i leaked | head -10

echo ""
echo "=== Checking declare_lint_rule! for fix_kind ==="
rg -A 5 "declare_lint_rule!" crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs 2>/dev/null | head -20

Repository: biomejs/biome

Length of output: 3281


🏁 Script executed:

#!/bin/bash

# Check the complete declare_lint_rule! block for fix_kind
echo "=== Full declare_lint_rule! block ==="
rg -A 50 "declare_lint_rule!" crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs 2>/dev/null | grep -E "(declare_lint_rule|fix_kind|name =|version =)" | head -10

# Also check if JsBigintLiteralExpression is handled anywhere
echo ""
echo "=== Checking for BigInt literal handling ==="
rg "JsBigintLiteralExpression" crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs

# Check the test file exists and what's in it
echo ""
echo "=== Test spec file contents (first 50 lines) ==="
if [ -f "crates/biome_js_analyze/tests/specs/nursery/noLeakedRender/valid.js" ]; then
    head -50 crates/biome_js_analyze/tests/specs/nursery/noLeakedRender/valid.js
elif [ -f "crates/biome_js_analyze/tests/specs/nursery/noLeakedRender/valid.ts" ]; then
    head -50 crates/biome_js_analyze/tests/specs/nursery/noLeakedRender/valid.ts
else
    find crates/biome_js_analyze/tests/specs/nursery/noLeakedRender -type f | head -3
fi

Repository: biomejs/biome

Length of output: 457


🏁 Script executed:

#!/bin/bash

# Get the full declare_lint_rule! block up to the closing brace
echo "=== Full declare_lint_rule! macro invocation ==="
awk '/^declare_lint_rule!\s*\{/,/^}/' crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs | head -80

echo ""
echo "=== Checking for fix_kind in the rule ==="
rg "fix_kind" crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs

Repository: biomejs/biome

Length of output: 2409


Specify fix_kind: FixKind::Safe in the macro and handle BigInt 0n literals.

The code correctly catches falsy literals (empty strings, null, numeric 0), but two issues remain:

  1. BigInt 0n is falsy and currently unhandled—it would fall through the match statement and be incorrectly treated as safe.
  2. The declare_lint_rule! macro is missing the fix_kind: FixKind::Safe declaration required for safe code actions (per the linting guidelines for this analyser).

The semantic model integration for variable resolution is solid and follows best practices.

🤖 Prompt for AI Agents
crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs lines 167-210: the
lint currently treats empty string, null, and numeric 0 as falsy but misses
BigInt 0n and the rule macro is missing its fix_kind; add a match arm for
AnyJsLiteralExpression::JsBigIntLiteralExpression (or whatever BigInt literal
variant your AST uses) and treat the token/text "0n" as falsy (return Some(())),
and update the declare_lint_rule! invocation for this rule to include fix_kind:
FixKind::Safe so safe code actions are allowed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai The rule doesn't implement the action function, which means that it can't have a code fix in its metadata

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ematipico, you're absolutely right! Thank you for the clarification. Since this rule only emits diagnostics and doesn't implement the action function to provide code fixes, fix_kind shouldn't be included in the metadata. I apologize for the confusion.

The BigInt 0n concern still stands though—the current match arms handle empty strings, null, and numeric 0, but BigInt literals like 0n (which are falsy) would fall through to the catch-all _ => return None and be treated as safe. If you'd like to handle that edge case, you could add:

AnyJsLiteralExpression::JsBigIntLiteralExpression(bigint) => {
    let value = bigint.value_token().ok()?;
    if value.text_trimmed() == "0n" {
        return Some(());
    }
    return None;
}

But that's optional depending on how common BigInt usage is in your target codebases.


✏️ Learnings added
Learnt from: ematipico
Repo: biomejs/biome PR: 8537
File: crates/biome_js_analyze/src/lint/nursery/no_leaked_render.rs:167-210
Timestamp: 2025-12-22T09:26:56.943Z
Learning: In crates/biome_analyze/**/*analyze/src/**/*.rs, the `fix_kind` field in `declare_lint_rule!` should only be specified when the rule implements the `action` function. Rules that only emit diagnostics without providing code fixes should not include `fix_kind` in their metadata.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Check if a variable is global using the semantic model to avoid false positives

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).same()` when implementing a rule that matches the behavior of an ESLint rule

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should perform static analysis of source code to detect invalid or error-prone patterns and emit diagnostics with proposed fixes

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Implement `action` function in Rule trait to provide code actions

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Lint rules should check syntax according to language specification and emit error diagnostics

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `declare_lint_rule!` macro to declare analyzer rule types and implement the RuleMeta trait

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Rules should tell the user what they should do to fix the error via code actions or notes

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `ctx.model()` to access semantic model information in a rule

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `Semantic<>` query type to access semantic model information like scopes and declarations

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Use `RuleSource::Eslint(...).inspired()` when implementing a rule inspired by but with different behavior than an ESLint rule

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Add `sources` field with `RuleSource` to cite ESLint or other rules that inspired the implementation

Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `language` to `jsx`, `ts`, or `tsx` for rules that only apply to specific JavaScript dialects

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Expand All @@ -205,7 +214,7 @@ impl Rule for NoLeakedRender {
return None;
}

Some(true)
Some(())
}
NoLeakedRenderQuery::JsConditionalExpression(expr) => {
let alternate = expr.alternate().ok()?;
Expand All @@ -216,7 +225,7 @@ impl Rule for NoLeakedRender {
return None;
}

Some(true)
Some(())
}
}
}
Expand Down Expand Up @@ -276,3 +285,17 @@ fn is_inside_jsx_expression(node: &JsSyntaxNode) -> Option<bool> {
|| AnyJsxElement::can_cast(parent.kind()),
)
}

fn find_variable(model: &SemanticModel, name: &JsReferenceIdentifier) -> Option<AnyJsExpression> {
let Some(binding) = model.binding(name) else {
return None;
};

let declaration = binding.tree().declaration()?;
let AnyJsBindingDeclaration::JsVariableDeclarator(declarator) = declaration else {
return None;
};

let expr = declarator.initializer()?.expression().ok()?;
return Some(expr);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,15 @@ const MyComponent5 = ({ data }) => {
const MyComponent6 = ({ value }) => {
return <div>{(((value))) && <Item />}</div>;
};

const isNaN = NaN;
const isZero = 0;
const emptyStr = '';
const MyComponent7 = () => {
return <>
<div> {isNan && 'NaN'} </div>
<div> {isZero && 'Zero'} </div>
<div>{emptyStr && "Empty String"}</div>
</>
}
Comment thread
dibashthapa marked this conversation as resolved.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ const MyComponent6 = ({ value }) => {
return <div>{(((value))) && <Item />}</div>;
};

const isNaN = NaN;
const isZero = 0;
const emptyStr = '';
const MyComponent7 = () => {
return <>
<div> {isNan && 'NaN'} </div>
<div> {isZero && 'Zero'} </div>
<div>{emptyStr && "Empty String"}</div>
</>
}


```

# Diagnostics
Expand Down Expand Up @@ -366,3 +378,66 @@ invalid.jsx:68:15 lint/nursery/noLeakedRender ━━━━━━━━━━━


```

```
invalid.jsx:76:10 lint/nursery/noLeakedRender ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Potential leaked value that might cause unintended rendering.

74 │ const MyComponent7 = () => {
75 │ return <>
> 76 │ <div> {isNan && 'NaN'} </div>
│ ^^^^^^^^^^^^^^
77 │ <div> {isZero && 'Zero'} </div>
78 │ <div>{emptyStr && "Empty String"}</div>

i JavaScript's && operator returns the left value when it's falsy (e.g., 0, NaN, ''). React will render that value, causing unexpected UI output.

i Make sure the condition is explicitly boolean.Use !!value, value > 0, or a ternary expression.

i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.


```

```
invalid.jsx:77:10 lint/nursery/noLeakedRender ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Potential leaked value that might cause unintended rendering.

75 │ return <>
76 │ <div> {isNan && 'NaN'} </div>
> 77 │ <div> {isZero && 'Zero'} </div>
│ ^^^^^^^^^^^^^^^^
78 │ <div>{emptyStr && "Empty String"}</div>
79 │ </>

i JavaScript's && operator returns the left value when it's falsy (e.g., 0, NaN, ''). React will render that value, causing unexpected UI output.

i Make sure the condition is explicitly boolean.Use !!value, value > 0, or a ternary expression.

i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.


```

```
invalid.jsx:78:9 lint/nursery/noLeakedRender ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Potential leaked value that might cause unintended rendering.

76 │ <div> {isNan && 'NaN'} </div>
77 │ <div> {isZero && 'Zero'} </div>
> 78 │ <div>{emptyStr && "Empty String"}</div>
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^
79 │ </>
80 │ }

i JavaScript's && operator returns the left value when it's falsy (e.g., 0, NaN, ''). React will render that value, causing unexpected UI output.

i Make sure the condition is explicitly boolean.Use !!value, value > 0, or a ternary expression.

i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.


```
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,23 @@ const isOpen2 = false;
const Component15 = () => {
return <Popover open={isOpen2 && items.length > 0} />;
};

const errorCount = 1;
const Component16 = () => {
return <div>{errorCount && 'Error'}</div>;
};

const isErr = errorCount > 0;
const Component17 = () => {
return <div>{isErr && 'Error'}</div>;
};

const someCondition = !!x;
const Component18 = () => {
return <div> {someCondition && 'hello'} </div>;
};

const isEqual = a == b;
const Component19 = () => {
return <div>{isEqual && 'Equal'}</div>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,24 @@ const Component15 = () => {
return <Popover open={isOpen2 && items.length > 0} />;
};

const errorCount = 1;
const Component16 = () => {
return <div>{errorCount && 'Error'}</div>;
};

const isErr = errorCount > 0;
const Component17 = () => {
return <div>{isErr && 'Error'}</div>;
};

const someCondition = !!x;
const Component18 = () => {
return <div> {someCondition && 'hello'} </div>;
};

const isEqual = a == b;
const Component19 = () => {
return <div>{isEqual && 'Equal'}</div>;
};

```
Loading