{"id":20393,"library":"prettier-plugin-nativewind","title":"prettier-plugin-nativewind","description":"A deprecated Prettier plugin for sorting Tailwind CSS classes in NativeWind projects. Version 0.2.3 is the final release. This fork added support for custom props, function calls, and tagged template literals beyond what upstream prettier-plugin-tailwindcss offered. However, as of prettier-plugin-tailwindcss v0.3.0 and later, all these features are natively supported, making this plugin obsolete. Users should migrate to the official plugin. No further updates are planned.","status":"deprecated","version":"0.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/nderscore/prettier-plugin-nativewind","tags":["javascript"],"install":[{"cmd":"npm install prettier-plugin-nativewind","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-nativewind","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-nativewind","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency – the plugin requires Prettier >=2.2.0 to function.","package":"prettier","optional":false}],"imports":[{"note":"No JavaScript import needed; the plugin is automatically detected by Prettier when listed in config.","wrong":"import or require the plugin directly in code – it is a Prettier plugin, not a programmatic API.","symbol":"default (plugin)","correct":"Add to prettier config as a plugin: module.exports = { plugins: ['prettier-plugin-nativewind'] }"}],"quickstart":{"code":"// prettier.config.js\nmodule.exports = {\n  plugins: ['prettier-plugin-nativewind'],\n  tailwindCustomProps: ['className', 'containerClassName'],\n  tailwindCustomFunctions: ['cva'],\n  tailwindCustomTaggedTemplates: ['tw']\n};\n\n// Input\nconst el = <div className=\"px-4 py-2 bg-blue-500 text-white\"></div>;\n\n// Output (sorted)\nconst el = <div className=\"bg-blue-500 px-4 py-2 text-white\"></div>;","lang":"javascript","description":"Shows how to configure the plugin with custom props and function calls, and demonstrates class sorting."},"warnings":[{"fix":"Replace prettier-plugin-nativewind with prettier-plugin-tailwindcss in devDependencies and remove any custom configuration specific to this fork (e.g., tailwindCustomProps).","message":"Package is deprecated; use prettier-plugin-tailwindcss instead.","severity":"deprecated","affected_versions":">=0.2.3"},{"fix":"Only install peer deps that are actually required by your project. The plugin works without them if you don't use those features.","message":"Peer dependencies include many optional peer deps like @ianvs/prettier-plugin-sort-imports. Installing them may cause conflicts if not needed.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use exact string matches unless you specifically need regex. For example, '^[a-z]+ClassName$' matches any prop ending with 'ClassName'.","message":"The plugin uses regular expressions for custom props/functions; starting a string with '^' enables regex mode. This can lead to unexpected matches if not used carefully.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"Update config to use the new option names if upgrading from v0.1.x.","message":"In v0.2.0, the option names changed: tailwindCustomProps replaced a previous undocumented option.","severity":"breaking","affected_versions":">=0.2.0 <0.3.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 prettier-plugin-nativewind --save-dev or yarn add -D prettier-plugin-nativewind.","cause":"The package is not installed or is missing from node_modules.","error":"Cannot find module 'prettier-plugin-nativewind'"},{"fix":"Ensure the option is an array, e.g., tailwindCustomProps: ['className'].","cause":"Option tailwindCustomProps (or similar) is not an array of strings.","error":"Error: Invalid plugin options. Expected an array of strings for `tailwindCustomProps`."},{"fix":"Ensure you have a tailwind.config.js or tailwind.config.ts in your project root, or configure the tailwindConfig option in Prettier config.","cause":"The plugin cannot find a Tailwind CSS configuration file or the config is invalid.","error":"TypeError: Cannot destructure property 'tailwindConfig' of 'undefined' or 'null'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}