Comments (3)
Thanks for sharing the link @avh4!
When elm-format
is installed globally via npm install --global elm-format
, everything works fine. The case I'm mentioning in this issue is when you only run npm install --global prettier-plugin-elm
, which in turn downloads and installs elm-format
as its dependency to /usr/local/lib/node_modules/elm-format/
. Unlike in local setups, there is no /usr/local/lib/node_modules/.bin
folder, so spawning elm-format
only involves a search in /usr/local/bin
. This folder does not contain elm-format
, because it has a status of a sub-dependency and npm decides not to pollute my global path with its binary.
Alternatively, I could move elm-format
to peerDependencies
and ask people to explicitly install it every time. But I guess it's better to keep this dependency tightly coupled with prettier-plugin-elm
so save someone from using incompatible version pairs.
from prettier-plugin-elm.
I tried to make guidelines for plugins to follow (avh4/elm-format#104), which currently says the following:
- Configuration
If the path to elm-format has not be explicitly specified by the user, the plugin should automatically find elm-format if it is located on the $PATH or in /usr/local/bin/.
Is there an equivalent of /usr/local/bin/ for Windows?
We should also add the path where
npm install -g
installs to, since this is the most common issue people have with plugin installationIf elm-format is not found, a message should be shown including a link to the elm-format installation instructions ( https://github.com/avh4/elm-format#installation- ). The message will be shown on the plugin settings screen if such a screen exists, and any time the user explicitly tries to format a file. The message may also be shown when the plugin is first installed or when saving an elm file.
I guess it needs to be updated to include a standard way for searching for elm-format installed with npm install -g
, as you've noted. (Thought won't things installed that way generally be on the user's $PATH
?)
from prettier-plugin-elm.
I believe this has been fixed in 6adc859, so there is no more need to install elm-format
globally in order to make prettier-plugin-elm
work.
Globally installed prettier
still fails to load plugins due to prettier/prettier#4000, however, it is possible to install my fork while we are waiting for a new version that includes prettier/prettier#4192.
from prettier-plugin-elm.
Related Issues (9)
- Forcing globally installed elm-format HOT 5
- is it possible to change to 2-space indentation? HOT 1
- Formatting markdown text works but not elm code blocks HOT 5
- Migrate to Prettier v3 HOT 3
- elm-format 0.8.6 HOT 3
- Update elm-format to 0.8.7 HOT 1
- Cannot read properties of undefined (reading 'parsers') HOT 7
- Consider removing prettier from peerDependencies
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-plugin-elm.