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

Order keys when formatting #2413

Closed
anthonyvdotbe opened this issue Mar 6, 2025 · 2 comments
Closed

Order keys when formatting #2413

anthonyvdotbe opened this issue Mar 6, 2025 · 2 comments

Comments

@anthonyvdotbe
Copy link

I would like my components to be consistent in the ordering of their key-value pairs: first the "reserved keys", in alphabetical order, followed by the "non-reserved keys", in declaration order.

For example:

x: {
  yet another
  another
  tooltip: bar
  shape: document
}

would be formatted as:

x: {
  shape: document
  tooltip: bar
  yet another
  another
}
@cyborg-ts cyborg-ts added this to D2 Mar 6, 2025
@bo-ku-ra
Copy link
Contributor

bo-ku-ra commented Mar 6, 2025

d2 is meaningful in order.
i would prefer not to change it.

x: {
  shape: document
  tooltip: bar
  yet another
  another
  shape: circle
}
x: {
  shape: circle
  shape: document
  tooltip: bar
  yet another
  another
}
x: {
  shape: document
  shape: circle
  tooltip: bar
  yet another
  another
}

there is also glob...

@anthonyvdotbe
Copy link
Author

Thanks for explaining, I agree.

@github-project-automation github-project-automation bot moved this to Done in D2 Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants