Closed greggh closed 4 years ago
It ignores any parser overrides indeed. It'll be fixed in the next release.
Out now 😊
Thanks for the quick update @alexanderweiss, I really appreciate it! But unlucky for me, I am still having the same problem.
I updated to the latest version of your extension (1.7.0) and my .prettierrc is the same one from above. I have the option turned on to format after saving, but I have also tried to just hit the menu item.
When I do that, nothing happens.
At the command line in that directory with the .prettierrc if I run "npx prettier file.njk" it prettifies the file.
Any thoughts?
Did you manage to get it working?
Did you manage to get it working?
Nope. At the command line prettier works fine with the njk files, in Nova the extension still seems to be ignoring them. No idea whats happening.
Ah. Since you closed it. Is it picking up on other configuration from your .prettierrc
file? And is the compatibility mode
option in the extension's preferences enabled by any chance?
Compatibility mode is off, and right now I don't have anything else in the .prettierrc file. I haven't needed any other config yet. Got anything that would be a good test in there?
Okay. Never mind. Seems like I actually broke immediately after adding support for it 😇. I'll release a fix right away.
There should be a new update now that does fix it!
That fixed it! Thank you.
Good to hear! Enjoy!
I'm trying to get my own prettierrc config working as well without much success. I have the following in a .prettierrc file in my project's root folder, but it never seems to be used. I've tried relaunching Nova several times without any luck. I'm fully willing to admit I'm new to Nova and Prettier so if I've missed anything feel free to point that out.
Using the prettier included with the extension.
.prettierrc content
{ "tabWidth": 4, "useTabs": true }
@vichudson1 Are you editing local or remote files? It doesn't currently work with remote files.
If you're editing local files, can you share the logs from the extension console (first enable extension development in Nova preferences), where your .prettierrc
is located, and whether Comptability mode is enabled in the extension's preferences (in the extension library)? Also, maybe create a separate issue so we don't annoy Gregg 😃.
I am using Nova to build a site with 11ty and its using the Nunjucks templating language. Prettier actually handles .njk files fine with withe html parser. So I created a .prettierrc file in the root of my project:
The formatting for that is a copy and paste directly from the website, with an edit for njk and html strings.
https://prettier.io/docs/en/configuration.html
After looking through the Issues that were already submitted and closed I saw one that said the prettier config was cached, so I restarted Nova. But that didn't help me.
Thanks for the awesome extension, I am just hoping we can figure this one out!