Skip to content

feat(attributes-order): allow attribute names in order - #3222

Open
ValentinYoushkevich wants to merge 6 commits into
vuejs:masterfrom
ValentinYoushkevich:feat/attributes-order-attribute-names
Open

ValentinYoushkevich wants to merge 6 commits into
vuejs:masterfrom
ValentinYoushkevich:feat/attributes-order-attribute-names

Conversation

@ValentinYoushkevich

@ValentinYoushkevich ValentinYoushkevich commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This lets the order option of vue/attributes-order take plain attribute names next to the group names, either as a separate entry or inside an array, as agreed in #2324. A name matches the attribute and its v-bind form, compared the way Vue does: in camelCase or kebab-case on components and <slot>, case-insensitively on HTML elements and exactly on SVG and MathML, so row-key also covers :row-key and :rowKey on a component; names that can never match, like v-if or :foo, fail validation. A matched attribute is placed by its name instead of the group it would otherwise fall into, so ['UNIQUE', 'row-key'] allows row-key before v-model, and ['data-test', 'data-testid'] after OTHER_ATTR keeps test ids at the end. Strings spelled like a group name are still rejected, so a typo like OTHER_ATTRS keeps failing validation, and configs without names behave as before.

Closes #2324, closes #2514

@changeset-bot

changeset-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3efad67

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-vue Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…rder-attribute-names

# Conflicts:
#	lib/rules/attributes-order.ts
Names are compared case-insensitively on HTML elements, exactly on SVG
and MathML, and in camelCase or kebab-case on components and `<slot>`,
also with the `.camel` modifier. `_` no longer matches `-`. Names that
can never match an attribute, like `v-if` or `:foo`, fail validation.
…t v8

ESLint v8's Linter defaults to the eslintrc mode, which does not validate
rule options, so the schema tests did not throw there.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make attributes "buckets" configurable vue/attributes-order: keep data-test attribute at the end of inline attributes

1 participant