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

no-unused-styles does not support destructuring assignment #124

Open
safaiyeh opened this issue Feb 7, 2017 · 9 comments
Open

no-unused-styles does not support destructuring assignment #124

safaiyeh opened this issue Feb 7, 2017 · 9 comments

Comments

@safaiyeh
Copy link

safaiyeh commented Feb 7, 2017

The styles are are marked as errors when the styles are destructed. Destructuring Assignment

class App extends Component {
  render() {
    const { container, welcome, instructions } = styles;

    return (
      <View style={container}>
        <Text style={welcome}>
          Welcome to React Native!
        </Text>
        <Text style={instructions}>
          To get started, edit index.ios.js
        </Text>
        <Text style={instructions}>
          Press Cmd+R to reload,{'\n'}
          Cmd+D or shake for dev menu
        </Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
});
@Intellicode
Copy link
Owner

Thanks for the issue, that should definitely be supported.

@jbreuer95
Copy link

+1

3 similar comments
@linnett
Copy link

linnett commented Jan 21, 2019

+1

@MrSucik
Copy link

MrSucik commented Apr 5, 2019

+1

@zchryst
Copy link

zchryst commented Jul 2, 2019

+1

@SusulAdam
Copy link

Hello, unfortunately the problem still persists

@jgutierrez11
Copy link

Any solution / workaround / alternative to this ?

@tulitheprogrammer
Copy link

#300

Added the support

Approve if you want to use it

@Noitham
Copy link

Noitham commented Sep 22, 2022

+1

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

10 participants