A CLI tool to lint and automatically fix unused style declarations in React Native and Aphrodite codebases. Version 1.3.0 is the latest stable release, with low release cadence. It works by static analysis of JS files, detecting styles that are never referenced. Key differentiators: supports both React Native and Aphrodite, offers safe (fix) and aggressive (fix-force) removal modes, and handles glob patterns for batch processing. Unlike general linting tools, it specifically targets style objects and can remove dead code programmatically.
npm install stylecleanupNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to install and use stylecleanup CLI to check and fix unused styles in a React Native or Aphrodite project.
Use fix-force to remove those as well, but be aware it may delete actually used styles.
Manually review the results when using fix commands; consider adding tests to verify style usage.
Consider alternatives like ESLint plugins (eslint-plugin-react-native or eslint-plugin-styled-components) for modern projects.
Test in a non-critical branch before running fix-force in production code.
Install babel-core explicitly: npm install babel-core@6
Transpile your source files to CommonJS before running stylecleanup, or use an older codebase.
Use npx stylecleanup instead: npx stylecleanup check ./src/**/*.js
No dependency data recorded yet.