adamzapasnik
Prettier eex plugin
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.
https://github.com/adamzapasnik/prettier-plugin-eex
If you got any questions ask here or on Github.
Most Liked
adamzapasnik
Release v0.2.0
Changes
- decoding/encoding logic has been extracted to prettier-html-templates package
Fixed
- In some cases expressions weren’t decoded inside script tags - thanks to @dnsbty
Extracting that logic allowed me to release an erb version, here is a link:
https://github.com/adamzapasnik/prettier-plugin-erb
PJUllrich
Small FYI if you want to install this wonderful plugin for every Elixir/Phoenix project:
- Install the
prettierandprettier-plugin-eexnpm packagesgloballywith:
npm install -g prettier prettier-plugin-eex
-
Make sure that you have the Prettier VSCode Extension installed.
-
Find the global path to which
npminstalled yourprettierpackage. 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 pathas aPrettier: Prettier Patheither in yourSettingsunderExtensions > Prettier > Prettier: Prettier Pathor in yoursettings.jsondirectly:
"prettier.prettierPath": GLOBAL_PATH
# e.g. "prettier.prettierPath": "/usr/local/lib/node_modules/prettier"
Thank you @adamzapasnik for this great plugin!
akoutmos
Last Post!
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









