Skip to content

Rule to enforce the inner order of Svelte 5 <script> block #1196

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

Open
AntonioVentilii opened this issue Apr 16, 2025 · 2 comments
Open

Rule to enforce the inner order of Svelte 5 <script> block #1196

AntonioVentilii opened this issue Apr 16, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@AntonioVentilii
Copy link

Description

It would be useful to have a rule that defines the order of the elements inside the <script> block.

For example, by default, could be imports -> props -> state -> stores -> contexts -> effects (or whatever works).

Idea by @DenysKarmazynDFINITY

@marekdedic
Copy link
Contributor

Hmm, that makes sense, but I think it would be quite hard - you'd have to in essence make a rule that enforces the ordering of any JS code...

@baseballyama
Copy link
Member

I’ve wanted this too. It would be great if we could implement a topological sort with preconditions.

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

3 participants