{"id":26441,"library":"stylecleanup","title":"Style Cleanup","description":"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.","status":"active","version":"1.3.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/jaredly/stylecleanup","tags":["javascript"],"install":[{"cmd":"npm install stylecleanup","lang":"bash","label":"npm"},{"cmd":"yarn add stylecleanup","lang":"bash","label":"yarn"},{"cmd":"pnpm add stylecleanup","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Primarily used as a CLI tool; install globally or use npx.","wrong":"npm run stylecleanup","symbol":"stylecleanup (CLI)","correct":"npx stylecleanup check ./src/**/*.js"},{"note":"This package is CLI-only; there is no programmable API to import.","wrong":null,"symbol":"default export","correct":"Not applicable (CLI-only; no programmatic API is documented)"}],"quickstart":{"code":"// Ensure you have stylecleanup installed globally\n// Then run on your source files:\nnpx stylecleanup check ./src/**/*.js\n\n// To automatically remove unused styles (safe mode):\nnpx stylecleanup fix ./src/**/*.js\n\n// To force-remove all potentially unused styles:\nnpx stylecleanup fix-force ./src/**/*.js","lang":"javascript","description":"Shows how to install and use stylecleanup CLI to check and fix unused styles in a React Native or Aphrodite project."},"warnings":[{"fix":"Use fix-force to remove those as well, but be aware it may delete actually used styles.","message":"fix command skips styles that might be used via computed property access (e.g., styles[something]), so not all unused styles are removed.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Manually review the results when using fix commands; consider adding tests to verify style usage.","message":"The tool only analyzes static references; dynamic style access patterns like Object.assign or spread operators may cause false negatives.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Consider alternatives like ESLint plugins (eslint-plugin-react-native or eslint-plugin-styled-components) for modern projects.","message":"The project appears to be unmaintained (last update around 2017); may not work with modern Babel or newer React Native versions.","severity":"deprecated","affected_versions":"=1.3.0"},{"fix":"Test in a non-critical branch before running fix-force in production code.","message":"No breaking changes documented; license is MIT but no changelog available.","severity":"breaking","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install babel-core explicitly: npm install babel-core@6","cause":"The tool depends on Babel 6 internally, which may not be installed or is incompatible with Babel 7+.","error":"Error: Cannot find module 'babel-core'"},{"fix":"Transpile your source files to CommonJS before running stylecleanup, or use an older codebase.","cause":"The tool does not support ES modules (import/export) by default; may require older Babel configuration.","error":"SyntaxError: Unexpected token import"},{"fix":"Use npx stylecleanup instead: npx stylecleanup check ./src/**/*.js","cause":"Global installation missing or not in PATH.","error":"stylecleanup: command not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}