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
There is a parent component, UserList, that defines a callback onSelectUser, which accepts an @inline fragment named UserList_onSelectUser_user.
This callback is passed to a UserDetail component as props.onSelectUser, to which a user is passed where ...UserList_onSelectUser_user is spread.
This eslint rule is not happy, and there is no sane way to work around this restriction, as far as I can tell. (One would have to import UserList from the child component, which is just silly!)
We do not want to allow users to suppress this rule, as in 99% of cases, this is a rule we don't want to let users suppress! We're still adopting Relay, so being forceful with respect to best practices is important to us.
We anticipate that this pattern will occur somewhat frequently for us.
What we would like feedback on
Would an ignore: RegExp parameter to the rule be an accepted addition? Namely, we would like to opt out of this lint rule by having certain inline fragments contain _inline_ in their name. (We would pair this with an additional rule, probably Pinterest-only, that enforced that only @inline fragments can contain _inline_ in their name.)
The text was updated successfully, but these errors were encountered:
rbalicki2
changed the title
RFC: add an ignore option to this eslint plugin
RFC: add an ignore option to the must-colocate-fragment-spreads rule
Feb 13, 2024
Why
We encounter the following pattern:
UserList
, that defines a callbackonSelectUser
, which accepts an@inline
fragment namedUserList_onSelectUser_user
.UserDetail
component asprops.onSelectUser
, to which auser
is passed where...UserList_onSelectUser_user
is spread.UserList
from the child component, which is just silly!)We anticipate that this pattern will occur somewhat frequently for us.
What we would like feedback on
ignore: RegExp
parameter to the rule be an accepted addition? Namely, we would like to opt out of this lint rule by having certain inline fragments contain_inline_
in their name. (We would pair this with an additional rule, probably Pinterest-only, that enforced that only@inline
fragments can contain_inline_
in their name.)The text was updated successfully, but these errors were encountered: