Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Convert inline-styes into independent styles? #281

Open
alamenai opened this issue Apr 1, 2021 · 0 comments
Open

[Feature] Convert inline-styes into independent styles? #281

alamenai opened this issue Apr 1, 2021 · 0 comments

Comments

@alamenai
Copy link

alamenai commented Apr 1, 2021

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

Screen Shot 2021-03-31 at 10 41 30 AM

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'
  },
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant