Skip to content

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

Closed
@ota-meshi

Description

@ota-meshi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions