eslint-plugin-react-native
                                
                                 eslint-plugin-react-native copied to clipboard
                                
                                    eslint-plugin-react-native copied to clipboard
                            
                            
                            
                        [no-inline-styles] ternary style gets mistakenly reported
I get a warning on this inline style:
<View
  style={[
    styles.safeAreaTransparent,
    { height: props.insetsTop ? insets.top : 0, },  // <---- eslint(react-native/no-inline-styles)
  ]}
/>
Does this behaviour work as expected? If so, how should we change these?
I think it should not report as a warning though ...
Yeah, all conditional expressions by default are considered invalid here. I think plugin should accept some pattern config to apply only certain validations and skip others.
I think it should be configureable, so that if there are variables in it, it should not report at all. Because it makes the code much more complicated with little benefit. If I am already using an inline style because of a conditional, I don't want to goo to the style definition and look up what style will be applied in the else case for example. But it totally makes sense for disabling inline styles in general for other cases
I think the plugin should accept conditional expressions etc.