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

Sort Attributes rule #417

Closed
azat-io opened this issue Sep 6, 2024 · 1 comment · Fixed by #423
Closed

Sort Attributes rule #417

azat-io opened this issue Sep 6, 2024 · 1 comment · Fixed by #423
Labels
enhancement New feature or request new rule

Comments

@azat-io
Copy link
Contributor

azat-io commented Sep 6, 2024

Motivation

Hello!

ESLint Plugin Perfectionist plans to deprecate from rules that use third-party parsers (azat-io/eslint-plugin-perfectionist#175).

We'd like to move a rule to you for sorting Astro element attributes.

Description

This rule is needed to sort attributes and create a consistent codebase style.

The rule should be able to sort attributes alphabetically and by line length. Sorting by descending and ascending should also be supported.

The rule should take into account spreads within Astro elements.

Examples

---
---

{/* ✓ GOOD */}
<Foo a="aaa" b="bb" c="c" />

{/* ✗ BAD */}
<Foo b="bb" c="c" a="aaa" />

Additional comments

No response

@azat-io azat-io added enhancement New feature or request new rule labels Sep 6, 2024
@ota-meshi
Copy link
Owner

Thank you for posting the issue!
It SGTM that we can provide that rule from this plugin.

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

Successfully merging a pull request may close this issue.

2 participants