Skip to content

Rule suggestion: events hash key should always be quoted #65

Description

@niksy

When you use events hash, you always quote key since it contains spaces:

{
    'click .foo': function ( e ) {
        // ...
    }
}

But if you try to set event handle on el itself, it is allowed to omit those quotes:

{
    click: function ( e ) {
        // ...
    }
}

Suggested rule will warn user to always put quotes around events hash key to keep it consistent with majority of use cases.

Potential issue I can see is that it could clash with quote-props rule.

What do you think?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions