Skip to content

jsx-no-leaked-render strategies question config question #3354

@flacoman91

Description

@flacoman91

Hello,

Is there a way to make coerce to be the preferred strategy, and to not adjust the code when there's a ternary ?

I have code that looks like
{ foo ? <thing1> : <anotherthing2>}

with coerce enabled as the rule, its converting the code to

{ !!foo && <thing1>} and i lose the else.

Is there a way to make coerce apply only when there's no ternary?

For instance, I would like the coerce rule to apply only when I do
{ foo && <thing> }

When I make ternary the default it converts all of the
{ foo && <thing> } to { foo ? <thing>: null }

Is it possible to have ternary and coerce as valid strategies without autofixing?

{ foo ? <thing1> : <anotherthing2>}
{ !!foo && <thing1>}

Thanks for your time!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions