-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support for key spacing alignment #835
Comments
Have you found any solution? I tried setting up Eslint Stylistic just for that as well but can't get it working so I gave up lol |
Sorry for the late reply. Yes it is possible with Stylistic, I don't have a configuration handy, but I ended up just changing where I put comments and so on to make it easier for me to reason about code. For example, in Go, the convention with structs it you put comments to the right of the fields if your comments are short. With TypeScript, I just interleave comments and I find it's perfectly readable. So I'm just using prettier now. I like dprint but it's slightly less readable imo than prettier because of some nuances around |
I'm primarily a Go developer and I love how gofmt aligns values, making it very easy to scan lines of code.
Without this, code reads as:
With this, code reads as:
I find the difference is night and day. Only typescript-eslint supports this https://typescript-eslint.io/rules/key-spacing/ but it's such a pain to configure eslint to work half as good as dprint, I'd love if this were a standard feature of dprint or in the least a plugin. Does anyone know how this would be implemented and can point me in the right direction or have interest in taking this on? My use case is only TS, JSON but I don't see why it couldn't be an optional dprint feature as well.
The text was updated successfully, but these errors were encountered: