evancz / elm-format-on-save

Sublime Text plugin to run elm-format on save
https://packagecontrol.io/packages/Elm%20Format%20on%20Save
BSD 3-Clause "New" or "Revised" License
23 stars 3 forks source link

Search for elm-format in node_modules #3

Open ad-si opened 4 years ago

ad-si commented 4 years ago

Installing any dependencies (even dev dependencies) globally is normally an anti pattern for node.js. So elm-format should be installed locally with npm install --save-dev elm-format and elm-format-on-save should check if the binary is available in node_modules/elm-format/bin/elm-format.

ringvold commented 4 years ago

So much yes! I ended up just installing it globally but it feels bad. It is an anti pattern but also the ability to have different versions of elm-format in projects is good so one can upgrade the projects at desired pace.

ad-si commented 2 years ago

Had this problem again, just to find out I already submitted an issue 1.5 years ago ☹️. Do you accept pull requests?

ringvold commented 2 years ago

I have wished for this feature many times since I commented here last. I can see that this feature seems unnecessary to some but I have found that I really want this feature so I have decided to create my own version of this plugin (https://github.com/ringvold/sublime-elm-format-runner). It aims to address #3 and #4. If/when these issued are fix or addressed in Elm Format On Save I will deprecate my version.

An alternative is to use the LSP plugin for Sublime Text with Elm-LSP which has support for elm-format installed locally. I use it some times but it is a much heavier plugin to run and I would like an lightweight alternative which does support local install of elm-format.