eslint-plugin-react-native
eslint-plugin-react-native copied to clipboard
[Feature] Convert inline-styes into independent styles?
Description
In react-native, eslint warns us to avoid inline-style in our components but it provides one solution by disabling the rule.
However, I'd recommend to add an option that let's convert inline-styles into independent styles.
Screenshot
Example
<Text style={{backgroundColor: 'green'}}>{section.title}</Text>
In the above snippet, eslint will have the ability to transform that rule into:
<Text style={styles.text}>{section.title}</Text>
const styles = StyleSheet.create({
text: {
backgroundColor: 'green'
},
});