Skip to content

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

License

Notifications You must be signed in to change notification settings

ony3000/prettier-plugin-merge

Repository files navigation

prettier-plugin-merge

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

Note: Prettier v3 is not yet supported.

The process of applying formats sequentially.

Installation

npm install -D prettier@~2.8 prettier-plugin-merge
yarn add -D prettier@~2.8 prettier-plugin-merge
pnpm add -D prettier@~2.8 prettier-plugin-merge

Configuration

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

JSON:

{
  "plugins": [
    "other-prettier-plugin-1",
    "other-prettier-plugin-2",
    "other-prettier-plugin-3",
    "prettier-plugin-merge"
  ]
}

JS:

module.exports = {
  plugins: [
    require('other-prettier-plugin-1'),
    require('other-prettier-plugin-2'),
    require('other-prettier-plugin-3'),
    require('prettier-plugin-merge'),
  ],
};