Registry / devops / prettier-plugin-properties

prettier-plugin-properties

JSON →
library0.3.1jsnpmunverified

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.

npm install prettier-plugin-properties
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-PR
P
prettier-plugin-properties
devopsjavascriptv0.3.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
✓ // In .prettierrc: plugins: ['prettier-plugin-properties']
✗ import plugin from 'prettier-plugin-properties'
This is a Prettier plugin, not a library with programmatic exports. It is configured via Prettier's plugins array.
escapeNonLatin1
✓ // In .prettierrc: { escapeNonLatin1: true }
✗ import { escapeNonLatin1 } from 'prettier-plugin-properties'
escapeNonLatin1 is an option passed to Prettier, not a named export from this package.
keySeparator
✓ // In .prettierrc: { keySeparator: ' = ' }
✗ const { keySeparator } = require('prettier-plugin-properties')
keySeparator is a Prettier option, not a package export. Must be set in Prettier config.

Shows installation, configuration with options, and formatting of a .properties file.

// Install npm install --save-dev prettier prettier-plugin-properties // .prettierrc { "plugins": ["prettier-plugin-properties"], "keySeparator": " = ", "escapeNonLatin1": false } // Run npx prettier --write file.properties // file.properties input name = John Doe age=30 key with spaces: value \u00e9\u00e0 // file.properties output name = John Doe age = 30 key with spaces = value \u00e9\u00e0
Debug
Known issues
breakingPrettier v3 no longer autoloads plugins. You must explicitly list plugins in config.
fix
Add 'prettier-plugin-properties' to the plugins array in .prettierrc or use --plugins in CLI.
affects: >=0.3.0
gotchaPlugin only works with Prettier >= 2.3.0 and Node.js >= 18 (v0.3.0+).
fix
Upgrade Prettier to 2.3+ and Node to 18+.
affects: >=0.3.0
deprecatedv0.2.0 dropped runtime dependency on linguist-languages, but configuration remains the same.
fix
No action needed; upgrade to v0.2.0 or later.
affects: 0.2.0
gotchaFeatures like escapeNonLatin1 only affect non-Latin-1 characters; Latin-1 characters (e.g., ñ) are left as-is.
fix
Use escapeNonLatin1: true to force escape of all non-Latin-1 characters.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'prettier-plugin-properties'
Plugin not installed or not in node_modules.
fix
Run npm install --save-dev prettier-plugin-properties
Configuration file contains a plugin that is not installed: prettier-plugin-properties
Plugin listed in .prettierrc but missing from node_modules.
fix
Install the plugin or remove it from the plugins array.
TypeError: Cannot read properties of undefined (reading 'properties')
The plugin expects a valid .properties file but the file is empty or malformed.
fix
Ensure the file has at least one key-value pair or comment.
Upgrade
Version history
0.3.1latest on npm
Audit
Dependencies
prettierrequiredPeer dependency: requires Prettier >= 2.3.0 to function as a plugin.
Agent activity
2 hits · last 30 days
node
2
Resources
prettier-plugin-properties — npm install prettier-plugin-properties · libregistry