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

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

Open
alkorlos opened this issue Jan 19, 2024 · 1 comment
Open

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

alkorlos opened this issue Jan 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@alkorlos
Copy link

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 alkorlos added the enhancement New feature or request label Jan 19, 2024
@DMartens
Copy link

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 <script> as that would be the only difference between the new rule and the core rule?

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

No branches or pull requests

2 participants