-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to prevent attribute wrapping? #67
Comments
anyone? |
You can use |
That's not an option. I want to disable it for the entire file. It puts every attribute of every line on new lines. If I put prettier-ignore on the entire file,the purpose of prettier is gone. |
I tried the snippet isolated and it didn't break (with the default <div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div class="fancy-stuff" id="element{{ loop.index }}"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> It breaks like you have mentioned: <div class="fancy-stuff"
id="element{{ loop.index }}"></div> I'm assuming you have something like this. Prettier's own HTML formatter pretty prints it when it's nested deeply like so: <div
class="fancy-stuff"
id="element{{ loop.index }}"
></div> If you would prefer Prettier's own formatting, I wrote a plugin for this Twig plugin that you can check out: prettier-plugin-twig-enhancements |
No I just want to keep all attributes on one line like so
|
Sorry I don't know how then. |
anyone? |
How can I prevent the attributes to wrap to new lines?
<div class="fancy-stuff" id="element{{ loop.index }}">
gets
I don't want the ID to wrap to a new line.
The text was updated successfully, but these errors were encountered: