Skip to content

Type imports do not follow rules from import/order #2347

Closed
@ImRodry

Description

@ImRodry

I have the import/order rule set up with the following configuration:

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

And I expected the groups rule to be applied to type imports, however this doesn't seem the case and these imports seem to just get sorted alphabetically. Here's an example:

// Sorted type imports by import/order
import type { Command } from "../../lib/imports"
import type { WithId } from "mongodb"
Expected sorting following the order external -> internal
import type { WithId } from "mongodb"
import type { Command } from "../../lib/imports"

As I understand this may be seen as expected behavior for some people, I believe this fix could be introduced as a boolean option for the rule that would come disabled by default.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy