Prettier plugin that sorts CSS property declarations into a rational order (positioning, box model, typography, visual, animation, misc). Version 1.0.3 is the latest stable release (no further releases since initial). It groups related properties together making styles more readable. Alternative to stylelint-based ordering like stylelint-config-rational-order, but works as a formatter instead of a linter. Supports CSS, SCSS, and Sass. Requires Prettier >=2.3.
npm install prettier-plugin-rational-orderVerified import paths — ran on the pinned version, not inferred.
Install the plugin, configure Prettier, create a CSS file with mixed order, run prettier, and view the reordered output.
Ensure the plugin is installed as a local devDependency, or specify the full path in the plugins array.
Use prettier --check to verify ordering without overwriting, and manually adjust if needed.
Use the appropriate Prettier config to associate the plugin with those file types.
Consider using stylelint-config-rational-order or a more actively maintained alternative.
Run npm install --save-dev prettier-plugin-rational-order
Set plugins to the relative path: 'plugins': ['./node_modules/prettier-plugin-rational-order']