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
What rule do you want to change?
vue/attributes-order
Does this change cause the rule to produce more or fewer warnings?
The same as before.
How will the change be implemented? (New option, new default behavior, etc.)?
More flexible configuration, e.g. by adding options.
Please provide some example code that this change will affect:
Quasar uses row-key in q-table that is IMO similar to key used for v-for.
Currently, I cannot order these to the same position, see examples below.
What does the rule currently do for this code?
q-table(v-model="row", row-key="id")
What will the rule do after it's changed?
By adding row-key to UNIQUE, it would allow:
Instead of "UNIQUE", you can specify the attributes directly, and you can use an array to allow them to be in any order internally, so e.g. replace "UNIQUE" with ["id", "row-key"] in your rule configuration.
I would like a possibility to just add some attributes without the need to redefine all existing ones nor the order of the buckets. But I will try the suggested solution.
Just to be sure, because that's not in the docs: I have to configure the order by using an array of attributes in place of UNIQUE? The docs just mention that possibility for using arrays of bucket names.
Error: .eslintrc.cjs:
Configuration for rule "vue/attributes-order" is invalid:
Value ["ref","key","row-key"] should be equal to one of the allowed values.
Value "ref" should be equal to one of the allowed values.
Value ["ref","key","row-key"] should match some schema in anyOf.
Arrays only accept group names for now, which is why that config fails. I suggested in #2324 to also allow plain attribute names in order, so ['UNIQUE', 'row-key'] would work for this case without redefining the other groups. I'll open a PR for both once that approach is OK.
Activity
FloEdelmann commentedon Jul 22, 2024
Instead of
"UNIQUE", you can specify the attributes directly, and you can use an array to allow them to be in any order internally, so e.g. replace"UNIQUE"with["id", "row-key"]in your rule configuration.markusheiden commentedon Jul 22, 2024
I would like a possibility to just add some attributes without the need to redefine all existing ones nor the order of the buckets. But I will try the suggested solution.
Just to be sure, because that's not in the docs: I have to configure the
orderby using an array of attributes in place of UNIQUE? The docs just mention that possibility for using arrays of bucket names.markusheiden commentedon Jul 22, 2024
That did not work:
ValentinYoushkevich commentedon Oct 28, 2026
Arrays only accept group names for now, which is why that config fails. I suggested in #2324 to also allow plain attribute names in
order, so['UNIQUE', 'row-key']would work for this case without redefining the other groups. I'll open a PR for both once that approach is OK.ValentinYoushkevich commentedon Oct 28, 2026
Opened #3222, which covers this with
['UNIQUE', 'row-key'].