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

[import/order] weird behavior when upgrading to 2.27.0 #2681

Closed
ImRodry opened this issue Jan 16, 2023 · 3 comments
Closed

[import/order] weird behavior when upgrading to 2.27.0 #2681

ImRodry opened this issue Jan 16, 2023 · 3 comments

Comments

@ImRodry
Copy link

ImRodry commented Jan 16, 2023

I was on 2.26.0 and was trying to update to 2.27.4 but started getting a weird error in 2 of the files on my project.
Here's my config for the import/order rule:

		"import/order": ["error", {
			"groups": [	"builtin", "external", "internal", "sibling", "index", "parent", "type"],
			"newlines-between": "always",
			"alphabetize": { "order": "asc", "caseInsensitive": true }
		}],

Here is what my file currently looks like - this was fine in 2.26.0
image
This is what the plugin wants it to look like
image
There are many issues with this:

  • "../commands/Utility/poll" appears right after the builtin modules, before external ones
  • "../config.json" appears after the discord.js external module import but before mongodb
  • "../events/crowdinverify" appears after mongodb but before node-cron, both external modules

On a different file I have a less obvious but equally weird error:
This is what the file looks like currently
image
This is what the plugin wants the file to look like:
image
Here I believe the bug happens because index and config are in the same directory, however, I only want index to show up before sibling files, and config should show up after as it is in the parent directory

I have files with similar structures where this is not an issue, so I'm not sure why it is on these 2 files.

@ImRodry
Copy link
Author

ImRodry commented Jan 16, 2023

This may or may not be related to #2669. Since I'm not sure, I decided to make a new issue about it.

@ljharb
Copy link
Member

ljharb commented Jan 16, 2023

I think this was fixed by #2674. Can you try v2.27.5 and see if it works?

@ImRodry
Copy link
Author

ImRodry commented Jan 16, 2023

There are still issues with this rule but those existed before 2.27.0 so I'll consider this fixed. Thanks!

@ImRodry ImRodry closed this as completed Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants