feat: sort deno “node:/npm:” imports/exports first#524
feat: sort deno “node:/npm:” imports/exports first#524denizdogan wants to merge 1 commit intodprint:mainfrom
Conversation
dsherret
left a comment
There was a problem hiding this comment.
Thanks, looks good, but instead of making this npm and node specific, perhaps we should make this "schemed"? So if a specifier starts with all letters then a colon it would be considered "schemed" and sort before "absolute", which could maybe be renamed to "bare". That way it's not Deno specific.
| Relative { relative_count: usize, folder_text: &'a str }, | ||
| Relative { count: usize, text: &'a str }, | ||
| Npm_ { text: &'a str }, | ||
| Node_ { text: &'a str }, |
There was a problem hiding this comment.
They were supposed to represent "npm:" and "node:" respectively, the underscore being the colon, but yeah, let me change those. :)
Yes, that makes sense. I'll revisit this soon. Thanks for the feedback! |
Makes it so that imports/exports that begin with
node:ornpm:are first in each set of declarations.I would really like something like this to be way more fleshed out, with more fine-grained configuration options, but I'd like to see if there's any interest first. If not, I might make a separate dprint plugin with this stuff.
Some notes:
Npm_andNode_names are meant to representnpm:andnode:Node_andNpm_is just sorted alphabetically, i.e. not by path depth