eslint-plugin-svelte icon indicating copy to clipboard operation
eslint-plugin-svelte copied to clipboard

Rule 'no-use-before-define' from eslint

Open alkorlos opened this issue 1 year ago • 1 comments

Description

Hello, thanks for the great tool

Eslint have rule 'no-use-before-define', it is useful in many situations, but have problem with Svelte:

+layout.svelte

<Header />

<script>
	import Header from '$lib/components/header/Header.svelte';
</script>

Will result: error 'Header' was used before it was defined no-use-before-define. This is correct behavior to JS, but not to Svelte.

Is there any way to improve compatibility?

alkorlos avatar Jan 19 '24 09:01 alkorlos

Also ran into this. When contributing this rule, should it support coarse options extending the existing options like props and components or just allow any reference outside the

DMartens avatar Apr 23 '24 19:04 DMartens