Skip to content

[import/order] option to either sort by export name or alias name #3181

Open
@robdasilva

Description

@robdasilva

Given the following configuration:

"import/order": [
    "error",
    {
        alphabetize: {
            order: "asc",
        },
        named: true,
    },
],

The following import statement will fail:

import { b, a as c } from "lib"

That's because a is expected to be before b. However, since a is being renamed to c, I would like to be able to determine the order based on the alias name.

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