import-js / import-js/eslint-plugin-import

two files from same directory in different groups

Open
#3,215 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

why are `ProjectLayout` and `MainLayout` not in the same group?

```
import { ProjectLayout } from 'src/layouts/main/ProjectLayout'

import { propsWithAuthentication } from 'src/core/propsWithAuthentication'
import { TaskSection } from 'src/sections/tasks/task/TaskSection'
import { useTranslation } from 'src/translations/i18n'
import propsWithTranslations from 'src/translations/propsWithTranslations'
```

vs

```
import { TableContextProvider } from 'src/components/Table/contexts/TableContext'
import { propsWithAuthentication } from 'src/core/propsWithAuthentication'
import { MainLayout } from 'src/layouts/main/MainLayout'
import { DeployedClassifersContextProvider } from 'src/sections/classifiers/deployed-classifiers/contexts/DeployedClassifiersContext'
import { DeployedClassifiersSection } from 'src/sections/classifiers/deployed-classifiers/DeployedClassifiersSection'
import propsWithTranslations from 'src/translations/propsWithTranslations'
```

config
```
'import/order': [
2,
{
named: true,
'newlines-between': 'always',
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'unknown',
'object',
'type',
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
pathGroups: [
{
pattern: 'react*',
group: 'external',
position: 'before',
},
{
pattern: '@**/**',
group: 'internal',
},
{
pattern: '@**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported import/order behavior with the two import examples and configuration shown in the issue. Trace how the rule classifies the two layouts and their path groups, then compare the resulting grouping with the report. Done means the differing treatment is explained and, if confirmed as a bug, covered by a regression test and corrected behavior.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.