{"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,"search_vec":"'2.0.0':45 '2021':52 'box':27 'compat':42 'config':55 'configur':39 'consist':23 'css':68 'css/scss':12 'declar':14 'depend':63 'differenti':53 'e.g':25 'enforc':21 'group':16,70 'infrequ':48 'instal':41 'javascript':64 'last':49 'like':36 'linter':35 'minim':38 'model':28 'order':6,24,69 'plugin':3,8,60,66 'posit':26 'postcss':62 'prettier':2,7,44,59,65 'prettier-plugin-two-style-ord':1 'properti':13,18 'relat':17 'releas':46 'requir':32 'separ':34 'sort':11 'style':5,67 'stylelint':37 'togeth':19 'two':4 'typographi':29 'updat':50 'v1.0.1':9 'visual':30 'without':31 'work':56 'zero':54","created_at":"2026-04-25T11:23:10.335087+00:00","updated_at":"2026-04-25T11:23:10.335087+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/chenshuai2144/prettier-plugin-two-style-order","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/prettier-plugin-two-style-order","openapi_spec":null,"status_page":null,"smithery":null,"categories":[],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}