-
-
Notifications
You must be signed in to change notification settings - Fork 223
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 requires alphabetically without removing unused requires #598
Comments
There's some work done already here: https://github.com/immoh/nsorg/ |
A good thing to have, but, please make it configurable via settings. I mean |
I think the first step here would be to make it on demand. So when you see kondo complain about this, you can issue the command to clean it up. |
I guess a nice goal could be that it plays nicely with the linter. This past couple of years I've worked in several JavaScript projects and ESLint and Prettier would respect/help each other so there are no conflicts between their configurations. |
Yes please! |
For reference, Emacs |
It seems this might be the best path: https://github.com/clojure-emacs/refactor-nrepl#clean-ns |
I believe we can soon do this via clojure-lsp 🎉 |
This has been released. See the |
@bpringe With all respect, clean ns is not the same as just ns sorting. I don't want a tool to remove requires automatically for me, to be honest. |
Oh, my apologies. Reopening this. |
Remove requires automatically can be super useful, but it's true that if it's happening on save, it can get in the middle of your workflow. |
To be clear, |
Coming from emacs, I like that you have just |
@ericdallo is the clojure-lsp extra command sort-clauses the way to do this? It seems to work if I with the cursor outside the |
@PEZ I never tested with require form because clean-ns most of the time is enough for most people and me, but seems like it should work as well 😆, and maybe we could improve it if we find anything not working as seems to makes sense to live in that code action. |
Thanks, @ericdallo. I'll close this for now then, as being implemented via the Sort List quick fix. We can reopen or open a new issue if we see that we need something more than this. |
Calva’s
clj-kondo
helps me detect when a require is not alphabetically sorted, but I’d love if Calva formats this automatically when I save the file, can it be done?The text was updated successfully, but these errors were encountered: