question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible with `prettier-plugin-twig-melody`

See original GitHub issue

Hello,

Regarding this part of the README.

This means this plugin is incompatible with other Prettier plugins that are using the same APIs. … If you discover any other incompatibilities, open an issue and hopefully we can figure out a way to make it work.

This plugin does not work with *.twig files, with prettier-plugin-twig-melody

prettier version: 2.5.1 prettier-plugin-twig-melody version: 0.4.6 tailwindcss version: 2.2.19

My .prettierrc.js

module.exports = {
  bracketSpacing: true,
  printWidth: 100,
  semi: true,
  singleQuote: true,
  tabWidth: 2,
  trailingComma: 'es5',
  useTabs: false,
  vueIndentScriptAndStyle: true,
  htmlWhitespaceSensitivity: 'ignore',
  twigPrintWidth: 100,
  twigMultiTags: ['html_element,end_html_element', 'with,endwith'],
  tailwindConfig: './tailwind.config.js'
};

Only the settings from the twig plugin are applied when running prettier, class names stay in the same order.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
reininkcommented, Jan 28, 2022

Hey! Thanks for reporting this. I’ve created a new issue (#31) dedicated to keeping track of Prettier plugins that are not compatible with this plugin. Closing this issue in favor of that 👍

Please feel free to post this incompatibility with prettier-plugin-twig-melody in that issue, it would be great to have it there for quick reference.

2reactions
perruchecommented, Jan 25, 2022

The source from the plugin does not have a parser for Twig: https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/src/index.js#L349

If a different approach can be taken to use this tailwind prettier plugin with twig files, i’m all ears

Anyway this plugin is 🔥

Read more comments on GitHub >

github_iconTop Results From Across the Web

prettier-plugin-twig-melody - npm
Prettier Plugin for Twig/Melody. Latest version: 0.4.6, last published: 3 years ago. Start using prettier-plugin-twig-melody in your project ...
Read more >
prettier-plugin-tailwindcss | Yarn - Package Manager
A Prettier plugin for Tailwind CSS v3.0+ that automatically sorts classes based on our recommended class order. Installation. To get started, just install ......
Read more >
Prettier - Nova Extensions - Panic Inc.
Code formatter using prettier. ... 1.8.1 - 2020-10-23. Added. Support syntax errors thrown by prettier-plugin-twig-melody ...
Read more >
Jonathan Reinink - Twitter
... prettier-plugin-style-order prettier-plugin-twig-melody ... This means this plugin is incompatible with other Prettier plugins that are using the .
Read more >
html prettier ignore | The AI Search Engine You Control
Turns off all rules that are unnecessary or might conflict with Prettier. ... Code formatting plugin for Prettier which can handle Twig/Melody templates....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found