You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish to ban the code as exactly specified in the jsx-prefer-fragment-wrappers docs page. So I added the rule to my eslintrc, which I was happy to see complain about the following scenario:
// Scenario 1 - THIS ERRORS - very good, I really want this rule
return (
<div>
<p>hi</p>
<p>hi</p>
</div>
)
However, there are 2 more scenarios which are much more strict that the original rule suggests it would be:
// Scenario 2 - THIS ERRORS - a little strict, but I like this
return (
<div>
<span>hi</span>
</div>
)
// Scenario 3 - THIS ERRORS - damn, this isnt good because we need code like this
return (
<div>
<div>
<p>hi</p>
</div>
<p>hi</p>
<p>hi</p>
</div>
)
Motivation
Scenario 1 is purely as described in the documentation. I love it.
Scenario 2: I like the above rule because the
could easily do the with pure CSS.
Scanerio 3: I dislike the above because often you will need the above html tree. I do agree that ideally, this rule would be active for the cleanest codebase, but our codebase isn't clean enough to be this pure.
However, the point of this ticket is to ask for an option where we can opt-out of Scenario 2 and 3, because they are objectively stricter than Scenario 1.
Scope/Area
I can't add labels but the rule name is @shopify/jsx-prefer-fragment-wrappers.
I didn't put this as a Feature Request because I cheekily assert that Scenario 2 and 3 are "false" positives that are also useful to have (but optionnally).
The text was updated successfully, but these errors were encountered:
Overview
I wish to ban the code as exactly specified in the jsx-prefer-fragment-wrappers docs page. So I added the rule to my eslintrc, which I was happy to see complain about the following scenario:
However, there are 2 more scenarios which are much more strict that the original rule suggests it would be:
Motivation
Scenario 1 is purely as described in the documentation. I love it.
Scenario 2: I like the above rule because the
Scanerio 3: I dislike the above because often you will need the above html tree. I do agree that ideally, this rule would be active for the cleanest codebase, but our codebase isn't clean enough to be this pure.
However, the point of this ticket is to ask for an option where we can opt-out of Scenario 2 and 3, because they are objectively stricter than Scenario 1.
Scope/Area
I can't add labels but the rule name is
@shopify/jsx-prefer-fragment-wrappers
.I didn't put this as a Feature Request because I cheekily assert that Scenario 2 and 3 are "false" positives that are also useful to have (but optionnally).
The text was updated successfully, but these errors were encountered: