eslint-plugin-react-native icon indicating copy to clipboard operation
eslint-plugin-react-native copied to clipboard

no-unused-styles shows error when style object property names are quoted

Open cameronsuen opened this issue 8 years ago • 0 comments

no-unused-styles reports unused style detected when the style object property names are quoted

const styles = StyleSheet.create({
    'container': {
        alignItems: 'center',
        backgroundColor: Color.white,
        flex: 1,
        justifyContent: 'center'
    }
});

/** Returns the application's root component
 * @returns {React.Component} root component
 */
export default function App () {

    return (
        <View style={styles.container}>
            <Text>Open up App.js to start working on your app!</Text>
            <Text>Changes you make will automatically reload.</Text>
            <Text>Shake your phone to open the developer menu.</Text>
        </View>
    );

}
eslint App.js
6:5  error  Unused style detected: styles                    react-native/no-unused-styles

cameronsuen avatar Jul 14 '17 06:07 cameronsuen