import-js/eslint-plugin-import

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

Open

#3,181 opened on 2025年4月24日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)JavaScript (4,946 stars) (1,540 forks)batch import
help wantedimport/export orderingsemver-minor

説明

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.

コントリビューターガイド

[import/order] option to either sort by export name or alias name · import-js/eslint-plugin-import#3181 | Good First Issue