prettier-plugin-ocd weekly downloads statistics
By nksrentas · npm · Prettier plugins
A Prettier plugin that automatically formats JSX attributes in ascending length order (creating a left triangle pattern), making React components more visually organized and consistent.
prettier-plugin-ocd has 10 recorded weekly downloads on npm, an increase of 150% over the past 30 days, ranking #3131 of 3,247 tracked listings.
About prettier-plugin-ocd
Prettier Plugin OCD :)
A Prettier plugin that automatically formats JSX attributes in ascending length order (creating a left triangle pattern), making React components more visually organized and consistent.
Features
- Automatically sorts JSX attributes by length (shortest to longest)
- Creates a visually appealing left triangle pattern
- Preserves non-JSX content
- Handles multiple JSX elements in the same file
- Full TypeScript support
- Maintains Prettier's high standards for code formatting
Installation
Using npm:
npm install --save-dev prettier-plugin-ocd
Using yarn:
yarn add -D prettier-plugin-ocd
Usage
The plugin will be automatically picked up by Prettier. No additional configuration is needed.
Before:
const Button = () => (
<button
className="primary-button"
onClick={handleClick}
id="submit"
disabled={isLoading}
>
Submit
</button>
);
After:
const Button = () => (
<button
id="submit"
onClick={handleClick}
disabled={isLoading}
className="primary-button"
>
Submit
</button>
);
Configuration
This plugin works out of the box with Prettier's default configuration. No additional settings are required.
How It Works
The plugin uses a sophisticated attribute processing system that:
- Parses the JSX using Babel
- Identifies all JSX attributes
- Calculates the length of each attribute
- Sorts them in ascending order
- Generates the formatted code while preserving all other formatting
License
Credits
Created by Nikos Rentas
FAQ
Q: Will this affect my code's functionality?
A: No, the plugin only changes the order of JSX attributes, which doesn't affect functionality.
Q: Does it work with all JSX/TSX files?
A: Yes, the plugin supports both JSX and TSX files.
Q: What happens if there's an error?
A: The plugin gracefully handles errors by returning the original code unchanged.
Requirements
- Node.js >= 14
- Prettier >= 2.0.0
Known Issues
None at the moment. If you find any issues, please report them in the GitHub issue tracker.
Description from the npm listing.
- prettier
- prettier-plugin
- left-triangle
- triangle
- react
- jsx
- tsx
- props
- ocd
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Prettier plugins plugins
All 20 prettier-plugin-ocd alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-ocd. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.