Skip to content

Compatibility with @shopify/prettier-plugin-liquid using tailwind prefix #163

@grantkang5

Description

@grantkang5

What version of prettier-plugin-tailwindcss are you using?

v0.3.0

What version of Tailwind CSS are you using?

v3.0.22

What version of Node.js are you using?

16.3.0

What package manager are you using?

Yarn

What operating system are you using?

macOS

Prettier Config

module.exports = {
  plugins: ["@shopify/prettier-plugin-liquid", "prettier-plugin-tailwindcss"],
  pluginSearchDirs: false,
  tailwindConfig: "./tailwind.config.js",
};

Tailwind Config

module.exports = {
  prefix: "tw-",
  plugins: [],
  corePlugins: {
    preflight: false,
  },
}

Describe your issue

We're using the plugin on top of @shopify/prettier-plugin-liquid. Running into issues with prettier when mixing in tailwind classes and non-tailwind classes with liquid syntax.

Project is using tailwind prefix tw-

Unformatted Code
<div class="tw-mx-auto tw-flex-row menu--{{ id }}">

Formatted
<div class="menu-- tw-mx-auto tw-flex-row{{ id }}">

Expected Result
<div class="tw-mx-auto tw-flex-row menu--{{ id }}">

It seems like non tailwind classes that are rearranged as a result of formatting aren't being moved along with liquid syntax.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions