Skip to content

When creating a unittest with Runes $derived runes are marked as "never reassigned" #846

@mrh1997

Description

@mrh1997

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?

8.57.0

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

2.43.0

What did you do?

test('Counter', () => {
	let count = $state(0);
	let double = $derived(count * 2);

	count = 5;

	expect(double).toEqual(10);
});

What did you expect to happen?

I expect that no error / warning is shown. Especially it should be detected that "double" will change its value.

What actually happened?

At the "double" definition the following error is displayed:

ESLint: 'double' is never reassigned. Use 'const' instead.(prefer-const

Additional comments

No response

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