0.5.0 • Published 4 years ago
@mokou/prettier-plugin-eex v0.5.0
Prettier EEX Plugin
How to install?
yarn add -D prettier prettier-plugin-eexSupported versions
- Elixir 1.8 minimum
- Erlang OTP 21 minimum
Config options
- printWidth - used by Prettier directly
- eexMultilineNoParens - Array - used to format multiline expressions, provide which functions shouldn't wrap parens around arguments
- eexMultilineLineLength - Number - used to format multiline expressions
Example:
{
"printWidth": 130,
"eexMultilineLineLength": 100,
"eexMultilineNoParens": [
"link",
"form_for"
]
}How to install in Phoenix project?
Add .prettierignore file with:
deps/
_build/
.elixir_ls
assets
privAnd .prettierrc.js
module.exports = {
printWidth: 120,
};cd assets
yarn add -D prettier prettier-plugin-eexHow to use?
Add to mix.exs aliases and use as mix prettier
defp aliases do
[...
prettier: "cmd ./assets/node_modules/.bin/prettier --check . --color"
]
endHow to make it work with Prettier Visual Studio code extension?
It's important to add node modules path.
"prettier.prettierPath": "./assets/node_modules/prettier"How to deal with bugs?
Your code wasn't formatted correctly or there was an error? Add the problematic file to .prettierignore and submit an Issue.
0.5.0
4 years ago