Skip to content

Conversation

ota-meshi
Copy link
Member

This PR adds svelte/sort-attributes rule that enforce order of attributes.

close #150

@ota-meshi ota-meshi marked this pull request as draft July 23, 2022 13:39
@tivac
Copy link
Collaborator

tivac commented Jul 23, 2022

Looked at the docs, love where this is headed and very impressed how fast it came together!

Quick question about the config format, I assume this uses standard regex flags so the /u usage in the examples isn't always necessary unless you need to match extended Unicode characters in attributes?

@ota-meshi
Copy link
Member Author

Thank you for checking! I will proceed with the implementation as it is 😉.

The u flag is not required. I like to use the u flag as similar to strict mode. The u flag will find the wrong use of the regex and let me know as an error. For example, new RegExp ('\\w{1,5', 'u')

@ota-meshi ota-meshi marked this pull request as ready for review July 24, 2022 14:00
@ota-meshi ota-meshi requested a review from JounQin July 25, 2022 03:29
@ota-meshi ota-meshi merged commit ce7db8a into main Jul 31, 2022
@ota-meshi ota-meshi deleted the sort-attributes branch July 31, 2022 04:50
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

Successfully merging this pull request may close these issues.

Add attribute sorting rule
3 participants