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

Does stylecleanup support imported styles ? #2

Open
Fafly opened this issue Apr 13, 2017 · 4 comments
Open

Does stylecleanup support imported styles ? #2

Fafly opened this issue Apr 13, 2017 · 4 comments

Comments

@Fafly
Copy link

Fafly commented Apr 13, 2017

We try stylecleanup on our codebase and it didn't find any unused styles.

We were wondering if stylecleanup is supposed to delete grayText in the example below.

// styles.js
import StyleSheet from 'react-native';

export default StyleSheet.create({
  grayText: {
    color: '#D0D0D0',
  },
  redText: {
    color: '#FF0000'
  },
});
// component.js
{...}
import styles from './styles.js';

class Example extends Component {
  render({
    <View>
      <Text style={styles.redText}>Error: ...</Text>
    </View>
  });
}
@jaredly
Copy link
Owner

jaredly commented Apr 20, 2017

it doesn't currently track styles across imports! That would be a great addition though

@Kerumen
Copy link

Kerumen commented Aug 23, 2017

I second this! Great tool but unusable for me as all my styles are in separate files 😞

@alexpchin
Copy link

This would be such a great feature!

@DracotMolver
Copy link

I think this is a very important feature because most of the project when get big they move the styles to a separate file. Maybe adding a file configuration that check all the relative files due a whitelist like styles.js or styles.js. The idea woud be to compare the styles in those files against the relative index.

/-Button
  |-styles.js // take the styles from here
  |-index.js // compare the styles agains this file

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

5 participants