Vue Formatting Issue: Controlling Line Breaks for Component Attributes
Answered
When a component has too many attributes to fit in one line, the formatter places each attribute on a separate line. How can I prevent it from doing this or stop it from automatically wrapping when it exceeds a certain length? I would like to control where the line breaks occur myself.
Before formatting:
After formatting:
Desired formatting:
Please sign in to leave a comment.
Formatting in the first screenshot can be caused by settings in File | Settings | Editor | Code Style | HTML - Other tab. Please ensure that:
1. 'Wrap attributes' is set to 'Do not wrap'.
2. 'New line before first attribute' is set to 'Never'.
If this does not help, ensure that other tools(for example., Prettier) do not affect formatting. You can try disabling it in Settings | Languages & Frameworks | JavaScript | Prettier.
Formatting in the first screenshot can be caused by settings in File | Settings | Editor | Code Style | HTML - Other tab. Please ensure that:
1. 'Wrap attributes' is set to 'Do not wrap'.
2. 'New line before first attribute' is set to 'Never'.
If this does not help, ensure that other tools(for example., Prettier) do not affect formatting. You can try disabling it in Settings | Languages & Frameworks | JavaScript | Prettier.