rn-native-stylesheet-cleaner
v1.0.2
Published
A utility tool to clean and optimize React Native stylesheets.
Maintainers
Readme
RN Native Stylesheet Cleaner
This project is a utility tool designed to clean and optimize React Native stylesheets. It helps in removing unused styles and organizing the stylesheet for better readability and maintainability.
Why
As of right now I've noticed biome and eslint both miss when we have unused style props and it's annoying to go through and manually remove leftover ones. So, I made this. Hope this speeds up your workflow and leads to less clutter in your files.
Features
- Identifies and removes unused styles
- ~~Organizes styles for better readability~~ TODO
- Supports both JavaScript and TypeScript React Native projects
Installation
To install the RN Native Stylesheet Cleaner, you can use npm or yarn:
npm install -g rn-native-stylesheet-cleaneror
yarn global add rn-native-stylesheet-cleanerUsage
To use the RN Native Stylesheet Cleaner, navigate to your React Native project directory and run the following command:
rn-native-stylesheet-cleanerYou can also use the shorthand command:
rn-ss-cleanerstyles-cleanerThis will scan your project for stylesheets, identify unused styles, and clean them up.
Options
-d, --directory <path>: Directory to parse (default:src)-i, --include <patterns>: File patterns to include (default:**/*.{jsx,tsx})-e, --exclude <patterns>: File patterns to exclude (default:'')--no-format: Run the cleaner without reformatting the output.--dry-run: Run the cleaner without making any changes, just to see what would be cleaned.--verbose: Output detailed information during the cleaning process.
Example:
rn-native-stylesheet-cleaner --dry-run --verboseContributing
Contributions are welcome! Please open an issue or submit a pull request with your changes.
Visual Studio Code Extension
There is also a Visual Studio Code extension version of this project available. You can find it at:
- GitHub: https://github.com/theBGuy/vs-react-native-stylesheet-cleaner
- Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=theBGuy.react-native-stylesheet-cleaner
License
This project is licensed under the MIT License.
