Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with prettier-plugin-tailwindcss #24

Open
jeannen opened this issue Mar 18, 2024 · 1 comment
Open

Incompatibility with prettier-plugin-tailwindcss #24

jeannen opened this issue Mar 18, 2024 · 1 comment

Comments

@jeannen
Copy link

jeannen commented Mar 18, 2024

Hey!

When used with prettier-plugin-tailwindcss module, it makes it stop working. The attributes are properly organized, but the class names inside the class attribute don't move.

Would be nice to fix it, we can't use the module otherwise (or have to choose one or the other) :(

I tried on a brand new project using the lastest versions.

Here is the prettier config:

{
    "trailingComma": "all",
    "tabWidth": 4,
    "semi": true,
    "singleQuote": true,
    "bracketSpacing": true,
    "bracketSameLine": false,
    "printWidth": 1000,
    "vueIndentScriptAndStyle": true,
    "singleAttributePerLine": false,
    "plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-organize-attributes"],
    "attributeGroups": ["^(:|v-)is$", "^v-for$", "^v-(if|else-if|else|show|cloak)$", "^v-(once|pre|memo)$", "^:?id$", "^:?key$", "^:?ref$", "^(v-)?slot$", "^#", "^v-model$", "^v-(?!bind|on|html|text)", "^class$", "^(v-bind)?:class$", "^((v-bind)?:)?(?!data-|v-|:|@|#)", "$DEFAULT", "^((v-bind)?:)?data-", "^v-bind$", "^v-on", "^@", "^v-html$", "^v-text$"]
}

If I remove prettier-plugin-organize-attributes, the tailwind one works.

@dolpox
Copy link

dolpox commented Apr 10, 2024

Refer to prettier-plugin-tailwindcss documentation.

The prettier-plugin-tailwindcss must come last.

// .prettierrc

{
  // ..
  "plugins": [
   "prettier-plugin-organize-attributes",
    "prettier-plugin-tailwindcss" // MUST come last
  ]
} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants