{"id":20448,"library":"prettier-plugin-two-style-order","title":"prettier-plugin-two-style-order","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/chenshuai2144/prettier-plugin-two-style-order","tags":["javascript","prettier","plugin","style","css","order","group"],"install":[{"cmd":"npm install prettier-plugin-two-style-order","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-two-style-order","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-two-style-order","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to run the plugin","package":"prettier","optional":false}],"imports":[{"note":"Prettier discovers plugins automatically if they are in node_modules. Manual import is unnecessary.","wrong":"import prettierPluginStyleOrder from 'prettier-plugin-two-style-order'","symbol":"default (plugin)","correct":"// No explicit import needed; Prettier auto-loads plugins named prettier-plugin-*"},{"note":"If automatic discovery fails, add to .prettierrc plugins array.","wrong":"// (Nothing common; just add the string to plugins array)","symbol":"plugins config","correct":"// In .prettierrc: { \"plugins\": [\"prettier-plugin-two-style-order\"] }"},{"note":"This plugin does not expose any configuration. Sorting order is fixed.","wrong":"// Setting styleOrder or similar config keys does nothing; the plugin has no options.","symbol":"style order options","correct":"// No options; plugin sorts automatically. Use .prettierrc for other prettier options."}],"quickstart":{"code":"npm install --save-dev prettier prettier-plugin-two-style-order\necho '{\n  \"semi\": true,\n  \"singleQuote\": true\n}' > .prettierrc\necho 'div {\n  color: red;\n  display: flex;\n  margin: 0;\n  font-size: 14px;\n}' > test.css\nnpx prettier --write test.css","lang":"javascript","description":"Installs dependencies, creates minimal Prettier config, and runs the plugin on a CSS file to sort properties."},"warnings":[{"fix":"Use an alternative like prettier-plugin-style-order or stick to Prettier v2.","message":"Plugin is incompatible with Prettier v3 (uses plugin API that was removed).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Check compatibility with your Prettier version or switch to actively maintained plugin.","message":"No updates since 2021; may not work with newer Prettier versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"If you need custom ordering, use a configurable plugin like prettier-plugin-style-order or stylelint.","message":"Plugin sorts properties automatically with no configuration – unexpected order may not match team preferences.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install the correct package: npm i -D prettier-plugin-two-style-order","message":"Installation guide in README says 'npm i -D prettier-plugin-style-order' which is a different package; actual package is prettier-plugin-two-style-order.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use stylelint or other tools for Less/other syntaxes.","message":"Plugin only works with CSS and SCSS; does not support Less or other preprocessors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev prettier-plugin-two-style-order","cause":"Plugin not installed or not in node_modules.","error":"Error: Cannot find module 'prettier-plugin-two-style-order'"},{"fix":"Remove any styleOrder or similar keys from .prettierrc; the plugin has no config.","cause":"Trying to pass non-existent options to the plugin.","error":"Error: Your configuration of Prettier contains unknown option(s): styleOrder"},{"fix":"Downgrade Prettier to v2 or switch to a compatible plugin.","cause":"Plugin uses deprecated Prettier API.","error":"Error: Plugin prettier-plugin-two-style-order is incompatible with Prettier v3"},{"fix":"Fix the CSS syntax error; only valid CSS/SCSS is processed.","cause":"File contains invalid CSS syntax.","error":"Error: prettier-plugin-two-style-order: Could not parse CSS: ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}