Open ad-si opened 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.
Had this problem again, just to find out I already submitted an issue 1.5 years ago ☹️. Do you accept pull requests?
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.
Installing any dependencies (even dev dependencies) globally is normally an anti pattern for node.js. So
elm-format
should be installed locally withnpm install --save-dev elm-format
and elm-format-on-save should check if the binary is available innode_modules/elm-format/bin/elm-format
.