Skip to content

warn about :click being a possible mistake ( user meant to use @click) #740

Closed
@sktguha

Description

@sktguha

Please describe what the rule should do:

If the programmer is using :click (instead of @click) to try to capture click event the rule should warn the user that :click will create a data attribute instead of listening in on the event handler , which they probably intended

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:

     <button :click="doSearchAction()">Search</button>

in the example above, it is correct code only, but this will result in an attribute called click created on the button with the value the result of doSearchAction

Additional context

Infact this rule can be extended for any dom events like focus,hover etc

I can start work on this if this is green lighted

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