# svelte/shorthand-attribute
enforce use of shorthand syntax in attribute
- đ§ The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
# đ Rule Details
This rule enforces the use of the shorthand syntax in attribute.
<script>
/* eslint svelte/shorthand-attribute: "error" */
</script>
<!-- â GOOD -->
<button {disabled}>...</button>
<!-- â BAD -->
<button Expected shorthand attribute. (svelte/shorthand-attribute)disabled={disabled}>...</button>
# đ§ Options
{
"svelte/shorthand-attribute": [
"error",
{
"prefer": "always" // "never"
}
]
}
prefer
"always"
âĻ Expects that the shorthand will be used whenever possible. This is default."never"
âĻ Ensures that no shorthand is used in any attribute.
# đĢ Related Rules
# đ Version
This rule was introduced in eslint-plugin-svelte v0.5.0