Skip to content

Prevent the use of the v-bind shorthand : on directives #1277

Closed
@peteruithoven

Description

@peteruithoven

Please describe what the rule should do:

Prevent the use of the v-bind shorthand : on directives.

What category should the rule belong to?

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

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

<input :v-model="message" >

<div :v-if="show" >Hello</div>

<input type="checkbox" 
  v-for="option of options"
  :key="option.value"
  :v-model="options"
  :value="option.value"
  :label="option.label" >

Additional context

We're using : so frequently it's an easy mistake to add it in front of an directive like v-if or v-model, the issue can be hard to notice. In case of the v-model the value just silently doesn't get updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions