alexanderweiss / nova-prettier

Prettier extension for Nova
MIT License
35 stars 6 forks source link

Is it possible to have a version that doesn't depend on node or npm? #33

Closed vichudson1 closed 3 years ago

vichudson1 commented 3 years ago

I'm getting this error others have reported.

Prettier couldn't be found because npm isn't available. Please make sure you have Node installed. If you've only installed Node through NVM, you'll need to change your shell configuration to work with Nova. See https://library.panic.com/nova/environment-variables/

I'm asking because there is also this other prettier extension, nova://extension/?id=vitaliykuzmenko.novaprettier&name=Prettier, that doesn't seem to need it. I'd rather use yours because you support more file types and have an option to disable the auto format on save for my projects though.

I don't do anything with Node and would prefer not to have to install it just for this extension.

alexanderweiss commented 3 years ago

It's possible to create a Prettier extension for Nova that doesn't require Node. This started out that way actually. But the problem is Prettier is primarily a Node-based project and unlike many other editors Nova doesn't come with a Node runtime. So that extension couldn't support Prettier's normal configuration and ignore files unless it reimplemented Prettier's logic for that, and couldn't support plugins — which quite a few people seem to use.

I think they are important features and I would expect many users to have Node anyways. So while I understand it might be nice and easy to not have the dependency, I don't think it's a viable option for a full-featured Prettier extension.

vichudson1 commented 3 years ago

Thanks for the detailed explanation. I definitely want the more full featured version of prettier. I'll go ahead and install Node.

alexanderweiss commented 3 years ago

No problem. Enjoy!