Skip to content

Rule enhancement: vue/attributes-order #968

Closed
@sense-it-gmbh

Description

@sense-it-gmbh

Please describe what the rule should do:

Enforce alphabetic order within attributes of same block (eg DEFINITION, LIST_RENDERING, see rule details). This concerns mainly the custom attributes and directives, events and global attributes (OTHER_DIRECTIVES, OTHER_ATTR, GLOBAL, EVENTS).

This could be an optional rule-option.

What category should the rule belong to?

  • Enforces code style
  • Warns about a potential error
  • Suggests an alternate way of doing something
  • Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<!-- ✓ GOOD -->
<my-component
  a-custom-prop="value"
  :another-custom-prop="1 + 1"
  :blue-color="false"
  boolean-prop-again
  z-prop="Z"
  @change="someMethod"
  @input="someOtherMethod"
>
  <!-- content -->
</my-component>

<!-- ✗ BAD -->
<my-component
  z-prop="Z"
  :another-custom-prop="1 + 1"
  :blue-color="false"
  boolean-prop-again
  a-custom-prop="value"
  @input="someOtherMethod"
  @change="someMethod"
>
  <!-- content -->
</my-component>

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions