Skip to content

Add rule: warn if entire attribute value is placed in es6 template literal #893

Open
@mustafa0x

Description

@mustafa0x

Motivation

some developers (and ai, too!) will write attributes in jsx style. eg <a href={`https://example.com${path}`}>link</a>.

in idiomatic svelte, this should be <a href="https://example.com{path}">link</a>

Description

warn on attr={``}

Examples

<script>
</script>

<!-- ✓ GOOD -->
<Foo attr="foo${bar}" />

<!-- ✗ BAD -->
<Foo attr={`foo${bar}`} />

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions