prettier-plugin-properties

0.3.0 • Public • Published

Prettier for .properties Files

Adds support to Prettier (v2.3 and later) for .properties files. To use, just install it:

npm install --save-dev prettier-plugin-properties

Prettier should then automatically detect and use the 'dot-properties' parser for .properties files.

For more information, see Prettier plugins documentation.

Configuration

In addition to the default options, two additional options are available:

Escape Non-Latin-1 Characters

Escape with \u all non-Latin-1 characters, to allow safely encoding output as ISO-8859-1.

Default CLI Override API Override
false --escape-non-latin1 escapeNonLatin1: <bool>

Key Separator

Set the separator to use between a property key and its value.

Valid options:
" " | ":" | "=" | ": " | "= " | " : " | " = "

Default CLI Override API Override
" = " --key-separator "<sep>" keySeparator: "<sep>"

Using Overrides

To apply separate Prettier configuration for different file types, you may use configuration overrides. For example:

{
  "overrides": [
    {
      "files": "*.properties",
      "options": {
        "printWidth": 0
      }
    }
  ]
}

Package Sidebar

Install

npm i prettier-plugin-properties

Weekly Downloads

11,133

Version

0.3.0

License

MIT

Unpacked Size

8.08 kB

Total Files

6

Last publish

Collaborators

  • eemeli