import-js / import-js/eslint-plugin-import
[import/order] option to either sort by export name or alias name
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Given the following configuration:
```js
"import/order": [
"error",
{
alphabetize: {
order: "asc",
},
named: true,
},
],
```
The following import statement will fail:
```js
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the import/order rule and its alphabetize handling; inspect the existing rule tests to understand how named imports are currently ordered. Add a configuration choice for export-name versus alias-name ordering, then verify the reported import example and existing ordering cases behave correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100