sveltejs/eslint-plugin-svelte

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

クローズ

#893 opened on 2024/10/29

 (1 件のコメント) (1 件のリアクション) (0 人の担当者)TypeScript (72 件のフォーク)auto 404
enhancementhelp wantednew rule

Repository metrics

Stars
 (400 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド