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] move nested import entries closer to the main import entry #2385

Closed
zaverden opened this issue Feb 17, 2022 · 3 comments · Fixed by #2396
Closed

[order] move nested import entries closer to the main import entry #2385

zaverden opened this issue Feb 17, 2022 · 3 comments · Fixed by #2396

Comments

@zaverden
Copy link

I want to keep next and next/* imports together

import Core from "next";
import Image from "next/image";
import Link from "next/link"
import Auth from "next-auth";

But the plugin forces me to break them with next-* imports

  import Core from "next";
+ import Auth from "next-auth";
  import Image from "next/image";
  import Link from "next/link"
- import Auth from "next-auth";

Same issue for the relative imports, the plugin wants me to change the order this way

  import e1 from "../businesses";
+ import e3 from "../businesses-users";
  import e2 from "../businesses/components";
- import e3 from "../businesses-users";
@ljharb
Copy link
Member

ljharb commented Feb 17, 2022

That seems like a legitimate bug; next/image should be sorted after next. We may need to split on / and sort by each part.

@pri1311
Copy link
Contributor

pri1311 commented Feb 24, 2022

Hey, I was going through the codebase and I believe I have a basic understanding about required changes for the particular issue. Would like to give it a try if the issue is up for grabs.

@ljharb
Copy link
Member

ljharb commented Feb 24, 2022

Go for it! Anything with "help wanted" that doesn't already have a PR associated, please feel free to submit one :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants