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

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

Closed
2 tasks done
mrh1997 opened this issue Sep 5, 2024 · 1 comment
Closed
2 tasks done

Comments

@mrh1997
Copy link

mrh1997 commented Sep 5, 2024

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

@ota-meshi
Copy link
Member

Duplicate of #818

@ota-meshi ota-meshi marked this as a duplicate of #818 Sep 13, 2024
@ota-meshi ota-meshi closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
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

No branches or pull requests

2 participants