Registry / prettier-plugin-two-style-order

prettier-plugin-two-style-order

JSON →
library1.0.1jsnpmunverified

Prettier plugin (v1.0.1) that sorts CSS/SCSS property declarations and groups related properties together. It enforces a consistent order (e.g., positioning, box model, typography, visual) without requiring a separate linter like stylelint. Minimal configuration—just install. Compatible with Prettier >=2.0.0. Releases are infrequent; last updated in 2021. Differentiators: zero config, works as a Prettier plugin, no postcss dependency.

npm install prettier-plugin-two-style-order
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-TW
P
prettier-plugin-two-style-order
javascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (plugin)
// No explicit import needed; Prettier auto-loads plugins named prettier-plugin-*
import prettierPluginStyleOrder from 'prettier-plugin-two-style-order'
Prettier discovers plugins automatically if they are in node_modules. Manual import is unnecessary.
plugins config
// In .prettierrc: { "plugins": ["prettier-plugin-two-style-order"] }
// (Nothing common; just add the string to plugins array)
If automatic discovery fails, add to .prettierrc plugins array.
style order options
// No options; plugin sorts automatically. Use .prettierrc for other prettier options.
// Setting styleOrder or similar config keys does nothing; the plugin has no options.
This plugin does not expose any configuration. Sorting order is fixed.

Installs dependencies, creates minimal Prettier config, and runs the plugin on a CSS file to sort properties.

npm install --save-dev prettier prettier-plugin-two-style-order echo '{ "semi": true, "singleQuote": true }' > .prettierrc echo 'div { color: red; display: flex; margin: 0; font-size: 14px; }' > test.css npx prettier --write test.css
Debug
Known issues
breakingPlugin is incompatible with Prettier v3 (uses plugin API that was removed).
fix
Use an alternative like prettier-plugin-style-order or stick to Prettier v2.
affects: >=1.0.0
deprecatedNo updates since 2021; may not work with newer Prettier versions.
fix
Check compatibility with your Prettier version or switch to actively maintained plugin.
affects: >=1.0.0
gotchaPlugin sorts properties automatically with no configuration – unexpected order may not match team preferences.
fix
If you need custom ordering, use a configurable plugin like prettier-plugin-style-order or stylelint.
affects: >=1.0.0
gotchaInstallation guide in README says 'npm i -D prettier-plugin-style-order' which is a different package; actual package is prettier-plugin-two-style-order.
fix
Install the correct package: npm i -D prettier-plugin-two-style-order
affects: >=1.0.0
gotchaPlugin only works with CSS and SCSS; does not support Less or other preprocessors.
fix
Use stylelint or other tools for Less/other syntaxes.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-two-style-order'
Plugin not installed or not in node_modules.
fix
Run: npm install --save-dev prettier-plugin-two-style-order
Error: Your configuration of Prettier contains unknown option(s): styleOrder
Trying to pass non-existent options to the plugin.
fix
Remove any styleOrder or similar keys from .prettierrc; the plugin has no config.
Error: Plugin prettier-plugin-two-style-order is incompatible with Prettier v3
Plugin uses deprecated Prettier API.
fix
Downgrade Prettier to v2 or switch to a compatible plugin.
Error: prettier-plugin-two-style-order: Could not parse CSS: ...
File contains invalid CSS syntax.
fix
Fix the CSS syntax error; only valid CSS/SCSS is processed.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
prettierrequiredpeer dependency: required to run the plugin
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-plugin-two-style-order — npm install prettier-plugin-two-style-order · libregistry