import-js / import-js/eslint-plugin-import
Regression in nested group order after v2.26
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
This is a follow-up to https://github.com/import-js/eslint-plugin-import/pull/2854#issuecomment-1781476606. I'm stuck in 2.26 because of a regression introduced in 2.27. Multiple reverts and updates try to fix the regression, but I still have a few spots where the regression shows up:
This is my configuration:
```js
"import/order": [
"error",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
groups: [
["external", "builtin"],
["parent", "sibling"],
],
"newlines-between": "always",
},
],
```
and typically, this used to pass in 2.26:
```ts
import { isNotNull } from "option-t/esm/Nullable";
import { combineNullables } from "../util/combineNullables.js";
import type { BigFraction } from "./BigFraction.js";
import { FRACTION_ZERO } from "./fraction.js";
```
but fails after 2.26 with message: `../util/combineNullables.js import should occur after import of ./fraction.js`
Contributor guide
Research direction
Start by reproducing the supplied import/order configuration and import sequence on versions 2.26 and 2.27. Trace the import/order rule's group-order handling to identify why the parent import is placed after the sibling import, then verify that the example passes with the intended ordering without regressing grouped imports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100