You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Support HTML/Vue Attribute Sorting #3382
Summary
It would be great to have configurable HTML attribute sorting support in Oxfmt, similar to what prettier-plugin-organize-attributes provides for Prettier.
Currently, Oxfmt supports sorting imports and Tailwind CSS classes, but there is no equivalent functionality for organizing HTML, Vue, or JSX attributes.
Motivation
In Vue projects, attribute order is an important part of maintaining consistent and readable templates.
For example, I would like to define a custom ordering for Vue directives, bindings, attributes, and event listeners:
This allows developers to enforce a consistent order across Vue templates instead of relying on the order in which attributes were originally written.
Suggested solution
Proposed Configuration
Ideally, Oxfmt could provide something similar to: { sortAttributes: { groups: [ "^v-if", "^v-else-if", "^v-else", "^v-for", "^v-model", "^v-", "$CODE_GUIDE", "^:", "$DEFAULT", "^tabindex", "^@" ], order: "asc" } }
Expected Benefits
Configurable attribute groups using regular expressions.
Support for Vue directives (v-if, v-for, v-model, etc.).
Support for HTML attributes and event listeners.
Support for JSX/TSX attributes where applicable.
Custom ordering and alphabetical sorting within groups.
Preservation of existing formatting behavior and attribute values.
Compatibility with Tailwind CSS class sorting.
Alternative
No response
Additional context
This feature would be particularly valuable for developers migrating from Prettier to Oxfmt who currently depend on prettier-plugin-organize-attributes.
It would also make Oxfmt's sorting capabilities more comprehensive and reduce the need for external formatting tools.
Would this functionality be considered within the scope of Oxfmt?
Activity
liangmiQwQ commentedon Nov 8, 2026
This is a feature about Oxfmt, could you please move to https://github.com/oxc-project/oxc repo to learn more?
Also, there is already a related issue on this topic: oxc-project/oxc#28453