linter: Import sort order seems silly and overcomplicates diffs
The import sorting order seems very arbitrary, and not very useful. What is worse is that it creates a lot of noise when reviewing git diffs. For example if I have import { g } from "./example.js" and then I modify it to be import { a, g } from "./example.js", oxlint wants me to move the whole import statement up or down, since it's looking at things like number of imports and alphabetically sorting import statements by their first imported member.
I'm wondering if it would be possible to sort import statements by the module path (alphabetically) first, then sort the members of an individual import. This way most git diffs would result in far less motion, import statements would only move up or down if the module path changed.
E.g.
import { c, x, y } from "./example_a.js";
import { a, h } from "./example_b.js";
import { b, j, p, w } from "./example_c.js"`
Here imports are sorted by their module path first (./example_a.js, ./example_b.js, ./example_c.js). This way adding or removing a member from any of the import statements does not require the order of import statements to change. It will always be ./example_a.js, then ./example_b.js, and finally ./example_c.js. This would make reviewing git diffs much easier to follow.
I realize there may be some extra complexity around things like importing modules for side effects.
I would also be nice if this were fixable automatically with the --fix option instead of manually reordering imports, but I'm assuming this is already on the roadmap?
I think going forward we should remove import sorting from the linter and implement it in the formatter.
Hi! Has there been any progress on auto-sorting imports? We'd love to adopt Oxlint at PostHog, but this is quite important to us.