0.6.0 • Published 3 months ago

prettier-plugin-merge v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

prettier-plugin-merge

A Prettier plugin that sequentially merges the formatting results of other Prettier plugins.

Schematic diagram of how formats are merged.

Installation

For Prettier v2:

npm install -D prettier@^2 prettier-plugin-merge

For Prettier v3:

npm install -D prettier prettier-plugin-merge

Configuration

Note: This plugin MUST come last. Other plugins usually have no order constraints.

JSON example:

{
  "plugins": [
    "prettier-plugin-tailwindcss",
    "prettier-plugin-classnames",
    "prettier-plugin-merge"
  ]
}

JS example (CommonJS module):

module.exports = {
  plugins: [
    '@trivago/prettier-plugin-sort-imports',
    'prettier-plugin-brace-style',
    'prettier-plugin-merge',
  ],
  braceStyle: 'stroustrup',
};

JS example (ES module):

export default {
  plugins: [
    'prettier-plugin-brace-style',
    '@trivago/prettier-plugin-sort-imports',
    'prettier-plugin-merge',
  ],
  importOrder: ['<THIRD_PARTY_MODULES>', '^@[^/]+/(.*)$', '^@/(.*)$', '^[./]'],
  importOrderSeparation: true,
};

Compatibility with other Prettier plugins

All other plugins used with this plugin must be compatible with your version of Prettier.

For example, suppose you have three plugins:

  • prettier-plugin-A: Only compatible with Prettier v2
  • prettier-plugin-B: Only compatible with Prettier v3
  • prettier-plugin-X: Compatible with both versions

Prettier v2 users can only configure prettier-plugin-A and prettier-plugin-X, and Prettier v3 users can only configure prettier-plugin-B and prettier-plugin-X.

0.6.0

3 months ago

0.5.0

4 months ago

0.5.1

4 months ago

0.4.0

5 months ago

0.3.0

7 months ago

0.3.1

7 months ago

0.2.2

7 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.1.2

8 months ago

0.1.1

10 months ago

0.1.0

11 months ago