-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Option to indent the closing bracket of a multiline element by +1 #501
Comments
There are two theoretical problems right now:
|
Not mutually exclusive! We have some amount props where the ordering is not easily expressed in a regexp, for example Vue components with multiple v-model bindings that might look like this: SomeComponent(
autoSortedPropsHere
v-model:first-prop="foo"
@update:first-prop="onFirstPropUpdate"
v-model:second-prop="foo"
@update:second-prop="onSecondPropUpdate"
) This is a case where it's nice to retain some freedom of manual sorting. We have a fair amount of components that also have props that you want to group semantically (non-optional field first, optional fields second, etc.) instead of alphabetically or in a globally fixed order. I agree that the built-in ways to auto-sort are powerful, but leaving a bit of freedom is the chef's kiss. On the first point... not much more to comment than HTML is a very different domain to pug when it comes to indentations and there this same thing does not matter much 😕 |
So because this would be potentially a new I suggest you to open up a PR and so we can explore of how easy or hard it is to implement and support/maintain. |
Request / Idea
Thanks for the plugin. We are migrating a sizeable codebase to use it. One currently impossible style opinion would be really helpful for us: indenting the trailing
)
of a multiline element to the same indent level as the props.Input
Expected Output
Crude Implementation
Additional Context
We feel this is preferable over the current default indent position as it allows you to both comment out the whole component one one go...
...as well as retains the ability to re-order the props easily without having to manually move the closing bracket to the end of the last prop.
Could this style be supported as an option? The code is trivial, so it's more of a bike-shedding question.
The text was updated successfully, but these errors were encountered: