adamzapasnik

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.

If you got any questions ask here or on Github.

Most Liked

adamzapasnik

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:

PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView

Small FYI if you want to install this wonderful plugin for every Elixir/Phoenix project:

  1. Install the prettier and prettier-plugin-eex npm packages globally with:
npm install -g prettier prettier-plugin-eex
  1. Make sure that you have the Prettier VSCode Extension installed.

  2. 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
  1. 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"

Thank you @adamzapasnik for this great plugin!

akoutmos

akoutmos

Author of Build a Weather Station with Elixir and Nerves

I’ll be taking a look for sure today! Thanks for this :smiley:

Where Next?

Popular in Announcing Top

tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
OvermindDL1
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM. ...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19103 141
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
riverrun
I’ve just released version 3 of Comeonin, a password hashing library. The following small changes have been made: changes to the NIF c...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
cjen07
parameterized pipe in elixir: |n&gt; edit: negative index in |n&gt; and mixed usage with |&gt; are supported example: use ParamP...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
josevalim
Hello everyone, We have just released NimbleCSV which is a small and fast CSV parsing library for Elixir. It allows developers to define...
New
marcuslankenau
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to pa...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43591 214
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
RisingFromAshes
I've read in another post that it may be possible with a router helper - but I couldn't find an appropriate one, and tbh, I'm still just ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; "XX...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement