Hey guys I’ve just released a prettier eex plugin.
It’s still a bit WIP, if you detect any errors just add a file path to .prettierignore and submit an issue so I could fix it.
It probably doesn’t work well with <style> and <script> tags, it something I have to work a bit more on.
Small FYI if you want to install this wonderful plugin for every Elixir/Phoenix project:
Install the prettier and prettier-plugin-eex npm packages globally with:
npm install -g prettier prettier-plugin-eex
Make sure that you have the Prettier VSCode Extension installed.
Find the global path to which npm installed your prettier package. These are some common paths:
# macOS
/usr/local/lib/node_modules/prettier
# unix
/usr/local/lib/node_modules/prettier
# Windows
%USERPROFILE%\AppData\Roaming\npm\node_modules/prettier
Set that global path as a Prettier: Prettier Path either in your Settings under Extensions > Prettier > Prettier: Prettier Path or in your settings.json directly:
"prettier.prettierPath": GLOBAL_PATH
# e.g. "prettier.prettierPath": "/usr/local/lib/node_modules/prettier"