Skip to content

False positives for bind:property={get, set} in no-sequences #646

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

Closed
4 tasks done
ota-meshi opened this issue Jan 15, 2025 · 0 comments · Fixed by #647
Closed
4 tasks done

False positives for bind:property={get, set} in no-sequences #646

ota-meshi opened this issue Jan 15, 2025 · 0 comments · Fixed by #647

Comments

@ota-meshi
Copy link
Member

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

  • I'm using eslint-plugin-svelte. (*.svelte file linting does not work with the parser alone. You should also use eslint-plugin-svelte with it.)
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-svelte repo and open the issue in eslint-plugin-svelte repo if there is no solution.
  • 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.18.0

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

What did you do?

Configuration
<!-- Paste your configuration here -->
import js from "@eslint/js";
import sveltePlugin from "eslint-plugin-svelte";
import svelteParser from "svelte-eslint-parser";
export default [
  js.configs.recommended,
  ...sveltePlugin.configs["flat/recommended"],
  {
    rules: {
      "no-sequences": "error",
    }
  },
  {
    files: ["**/*.svelte.js", "*.svelte.js"],
    languageOptions: {
      parser: svelteParser,
    }
  },
];
<script lang="ts">
  let value = $state('');
</script>

<input bind:value={
	() => value,
	(v) => value = v.toLowerCase()}
/>

What did you expect to happen?

I expected the rules to not warn me of anything.

What actually happened?

Unexpected use of comma operator. (no-sequences) [6:13-14]

Link to GitHub Repo with Minimal Reproducible Example

https://eslint-online-playground.netlify.app/#eNp9UtFO3DAQ/JWVVYm7E0mu6lvKoUr0sVX7jqnkJpuTD2cdbCeA0P07GzuBHCDyEMnrmdnZWT8J76ri9+OVbTtLSCH3A5qAohQXvnK6C2AU7XdSBC/FpSQAgwEGZXqEHXzxQQVcnZ2tv0u6KBKDUXzQ1PUB/muqy4jePXE5rNawu0z083geXgusN+TB/rL36K6Ux9X6KKlgNXEu0BvN5ipLjd7nB8/+NDt2AQ4eGmdbkOJHAhUHdsp2pvs0z1/T7zXNyATMuljMEuIDjnIe3cxJtWymxrvIwYfIqbFRvQlwPWZ08JNVnzusbNsi1VjzxAB5PkWcLM24aykao0KxgEtxExkcHPDneoO+nE/AlshmHu96pAp55HIczDnLriINgOPj31Kj0VGDm202xWYywnEyhdknhdSb183r79Ue/3RBW1oaSBmUJ2m97XzDAfH6OlXdsgYLW+LVRQl+Uo8dxz76bm3N003Gpahx+IndGAJVOs02dT3d8kjl0NCHl5nn5X56+XbzI/Tft3ybb7PtAry8fqf08XuISl9npZiCpKM4PgPk/SHt

Additional comments

bind:property={get, set} seems to be a feature added in Svelte 5.9.0.
https://svelte.dev/docs/svelte/bind#Function-bindings

Since this is not a sequence expression, I think it requires AST changes.

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

Successfully merging a pull request may close this issue.

1 participant