trivago / prettier-plugin-twig-melody

Code formatting plugin for Prettier which can handle Twig/Melody templates
Apache License 2.0
155 stars 35 forks source link

Prettier globally installed issue #36

Closed LouisCuvelier closed 4 years ago

LouisCuvelier commented 4 years ago

Hi,

I tried to use this plugin with Prettier installed globally. The folder is ~/.config/yarn/global/ and my .prettierrc.js is in it. Here's the config :

module.exports = {
  twigMultiTags: [
    "nav,endnav",
    "switch,case,default,endswitch",
    "ifchildren,endifchildren",
    "cache,endcache"
  ]
};

I did the command prettier --write "**/*.twig" and it returned Could not load plugin path ~/.config/yarn/global/node_modules/prettier-twig-craft-cms

I also tried to specify in the config the plugin path, but it changes nothing.

Any clue ?

chasegiunta commented 4 years ago

@LouisCuvelier the prettier-twig-craft-cms package that @twbartel was experimenting with is not one you'd want to use. I haven't tried installing prettier-plugin-twig-melody globally, but using this package locally to the project should work.

LouisCuvelier commented 4 years ago

Oh ... shame on me. Sorry for the waste of time ... Moreover, after a rebooting, everything is working fine now 😄

twbartel commented 4 years ago

Thanks @chasegiunta for taking care!