Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adamzapasnik/prettier-plugin-eex
Prettier EEX plugin
https://github.com/adamzapasnik/prettier-plugin-eex
Last synced: 28 days ago
JSON representation
Prettier EEX plugin
- Host: GitHub
- URL: https://github.com/adamzapasnik/prettier-plugin-eex
- Owner: adamzapasnik
- License: mit
- Created: 2021-01-25T17:29:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T13:59:22.000Z (almost 2 years ago)
- Last Synced: 2024-11-11T10:53:36.163Z (about 1 month ago)
- Language: JavaScript
- Size: 353 KB
- Stars: 114
- Watchers: 2
- Forks: 6
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- beamtoolbox - [ex
README
# Prettier EEX Plugin
## How to install?
```sh
yarn add -D prettier prettier-plugin-eex
```## Supported versions
- Elixir 1.10 minimum
- Erlang OTP 22 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 expressionsExample:
```js
{
"printWidth": 130,
"eexMultilineLineLength": 100,
"eexMultilineNoParens": [
"link",
"form_for"
]
}
```## How to install in Phoenix project?
Add .prettierignore file with:
```plain
deps/
_build/
.elixir_ls
assets
priv
```And .prettierrc.js
```js
module.exports = {
printWidth: 120,
};
``````sh
cd assets
yarn add -D prettier prettier-plugin-eex
```### How to use?
Add to `mix.exs` `aliases` and use as `mix prettier`
```elixir
defp aliases do
[...
prettier: "cmd ./assets/node_modules/.bin/prettier --check . --color"
]
end
```### How to make it work with Prettier Visual Studio code extension?
It's important to add node modules path.
```json
"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.