Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mustafa0x opened this issue Oct 29, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed new rule

Comments

@mustafa0x
Copy link

mustafa0x commented Oct 29, 2024

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

@mustafa0x mustafa0x added enhancement New feature or request new rule labels Oct 29, 2024
@mustafa0x mustafa0x changed the title Add rule: disable es6 template literals (eg ``{foo${bar}}``) in attributes Add rule: disable es6 template literals in attributes Oct 29, 2024
@mustafa0x mustafa0x changed the title Add rule: disable es6 template literals in attributes Add rule: warn if entire attribute value is placed in es6 template literal Oct 29, 2024
@ota-meshi
Copy link
Member

Thank you for proposing the rule!
That's sounds good to me!

@ota-meshi ota-meshi added the help wanted Extra attention is needed label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed new rule
Projects
None yet
Development

No branches or pull requests

2 participants