{"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,"search_vec":"'-1':56 '-8859':55 '0.3.1':17 '1':51 'activ':24 'add':10 'cadenc':22 'charact':52 'colon':65 'comment':80 'correct':88 'customiz':59 'dedic':34 'differenti':43 'encod':57 'equal':66 'escap':47,87 'file':5,15,41 'format':13,35 'formatt':72 'generic':71 'handl':79 'includ':44 'integr':27 'iso':54 'java':38 'java-styl':37 'javascript':89 'key':42,61 'key-valu':60 'later':32 'latin':50 'line':83 'mainten':25 'multi':82 'multi-lin':81 'non':49 'non-latin':48 'plugin':2,8,74,92 'prettier':1,7,29,90 'properti':4,14,40,77,91 'provid':33 'releas':21 'separ':63 'space':64,69 'stabl':20 'style':39 'support':11,45 'syntax':78 'understand':75 'unicod':86 'unlik':70 'v2.3':30 'valu':62,84 'various':68 'version':16","created_at":"2026-04-25T11:22:57.035700+00:00","updated_at":"2026-04-25T11:22:57.035700+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/eemeli/prettier-plugin-properties","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/prettier-plugin-properties","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","serialization"],"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}}