{"id":20406,"library":"prettier-plugin-properties","title":"Prettier Plugin for Properties Files","description":"A Prettier plugin that adds support for formatting .properties files, version 0.3.1, with a stable release cadence and active maintenance. It integrates with Prettier v2.3 and later, providing dedicated formatting for Java-style property files. Key differentiators include support for escape non-Latin-1 characters (for ISO-8859-1 encoding) and customizable key-value separators (space, colon, equals with various spacing). Unlike generic formatters, this plugin understands the .properties syntax, handling comments, multi-line values, and Unicode escaping correctly.","status":"active","version":"0.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/eemeli/prettier-plugin-properties","tags":["javascript","prettier","properties","plugin"],"install":[{"cmd":"npm install prettier-plugin-properties","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-properties","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-properties","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: requires Prettier >= 2.3.0 to function as a plugin.","package":"prettier","optional":false}],"imports":[{"note":"This is a Prettier plugin, not a library with programmatic exports. It is configured via Prettier's plugins array.","wrong":"import plugin from 'prettier-plugin-properties'","symbol":"plugin","correct":"// In .prettierrc: plugins: ['prettier-plugin-properties']"},{"note":"escapeNonLatin1 is an option passed to Prettier, not a named export from this package.","wrong":"import { escapeNonLatin1 } from 'prettier-plugin-properties'","symbol":"escapeNonLatin1","correct":"// In .prettierrc: { escapeNonLatin1: true }"},{"note":"keySeparator is a Prettier option, not a package export. Must be set in Prettier config.","wrong":"const { keySeparator } = require('prettier-plugin-properties')","symbol":"keySeparator","correct":"// In .prettierrc: { keySeparator: ' = ' }"}],"quickstart":{"code":"// Install\nnpm install --save-dev prettier prettier-plugin-properties\n\n// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-properties\"],\n  \"keySeparator\": \" = \",\n  \"escapeNonLatin1\": false\n}\n\n// Run\nnpx prettier --write file.properties\n\n// file.properties input\nname = John Doe\nage=30\nkey with spaces: value\n\\u00e9\\u00e0\n\n// file.properties output\nname = John Doe\nage = 30\nkey with spaces = value\n\\u00e9\\u00e0","lang":"javascript","description":"Shows installation, configuration with options, and formatting of a .properties file."},"warnings":[{"fix":"Add 'prettier-plugin-properties' to the plugins array in .prettierrc or use --plugins in CLI.","message":"Prettier v3 no longer autoloads plugins. You must explicitly list plugins in config.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Upgrade Prettier to 2.3+ and Node to 18+.","message":"Plugin only works with Prettier >= 2.3.0 and Node.js >= 18 (v0.3.0+).","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"No action needed; upgrade to v0.2.0 or later.","message":"v0.2.0 dropped runtime dependency on linguist-languages, but configuration remains the same.","severity":"deprecated","affected_versions":"0.2.0"},{"fix":"Use escapeNonLatin1: true to force escape of all non-Latin-1 characters.","message":"Features like escapeNonLatin1 only affect non-Latin-1 characters; Latin-1 characters (e.g., ñ) are left as-is.","severity":"gotcha","affected_versions":">=0.1.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-properties","cause":"Plugin not installed or not in node_modules.","error":"Cannot find module 'prettier-plugin-properties'"},{"fix":"Install the plugin or remove it from the plugins array.","cause":"Plugin listed in .prettierrc but missing from node_modules.","error":"Configuration file contains a plugin that is not installed: prettier-plugin-properties"},{"fix":"Ensure the file has at least one key-value pair or comment.","cause":"The plugin expects a valid .properties file but the file is empty or malformed.","error":"TypeError: Cannot read properties of undefined (reading 'properties')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}