Skip to content

New rule: prefer-true-attribute-shorthand #1781

Closed
@g-plane

Description

@g-plane

Please describe what the rule should do:

In template, if there's an attribute whose value is true, such as :show="true", this rule will warn and provide auto fix (becomes show, see the example below). This can reduce verbosity.

What category should the rule belong to?

[x] Suggests an alternate way of doing something (suggestion)

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

Invalid:

<template>
  <my-dialog :show="true" />
</template>

which can be fixed to:

<template>
  <my-dialog show />
</template>

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