Skip to content

consistent-selector-style: False positives with dynamic names in each blocks #1229

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

Open
2 tasks done
marekdedic opened this issue May 18, 2025 · 2 comments · May be fixed by #1231
Open
2 tasks done

consistent-selector-style: False positives with dynamic names in each blocks #1229

marekdedic opened this issue May 18, 2025 · 2 comments · May be fixed by #1231

Comments

@marekdedic
Copy link
Contributor

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

9.26.0

What version of eslint-plugin-svelte are you using?

04ca0d1

What did you do?

{#each ["one", "two"] as count}
  <b class={"bold-" + count}>Bold in each</b>
{/each}

<style>
  .bold-one {
    color: red;
  }

  .bold-two {
    color: blue;
  }
</style>

What did you expect to happen?

No error or suggesting to use ID

What actually happened?

Sufggesting using element type

Link to GitHub Repo with Minimal Reproducible Example

N/A

Additional comments

Will make a PR

@marekdedic
Copy link
Contributor Author

To implement this correctly, I am probably going to need to count the number of occurrences of each node... Is that something that is worth doing more generally?

@marekdedic
Copy link
Contributor Author

It turned our the issue was more general...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant