ony3000 / prettier-plugin-merge

A Prettier plugin that sequentially merges the formatting results of other Prettier plugins.
MIT License
24 stars 1 forks source link

If pass a path instead of a plugin name, that plugin will not be applied #15

Closed ony3000 closed 8 months ago

ony3000 commented 8 months ago

Dependency information

Steps to reproduce

  1. Set the plugins in prettier config as follows:
plugins: [
  'prettier-plugin-tailwindcss',
  'prettier-plugin-merge',
],
  1. Try to run this test.
test('tailwindcss', async () => {
  expect(
    await format(`export function Counter() {\n  return <span className="font-bold px-1">{count}</span>;\n}`, {
      ...defaultOptions,
      filepath: 'Counter.jsx',
      plugins: [
        require.resolve('prettier-plugin-tailwindcss'),
        'prettier-plugin-merge',
      ],
    }),
  ).toBe(`export function Counter() {\n  return <span className="px-1 font-bold">{count}</span>;\n}\n`);
});

The current behavior

Test failed.

The expected behavior

Test passed.

Refs