Skip to content

Sorting of "type FooX" and "Foo" imports disagrees with typescript, dprint #124

@jakebailey

Description

@jakebailey

I have something like this:

import { Foo, type FooX } from "foo";

TypeScript's sort/organize imports as well as dprint's (so, deno fmt too) case insensitive sortings both order these with Foo first, then type FooX, as above.

However, simple-import-sort appears to flip them, putting type FooX before Foo, like:

import { type FooX, Foo } from "foo";

Even though if the type keyword were removed, it'd sort the other way.

This leads to a frustrating scenario in my editor where the formatter and eslint fix both run and flip it back and forth, leaving nobody happy.

The only clue I have about this is the mention of \u0000 in the readme, but I'm not sure how "Foo" would sort after "FooX\u0000".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions