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

Scoped package @org/package ignored by import/order

Open
#1,399 8 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Config

"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
]
}
]

### Actual/no error

import { withStyles } from '@material-ui/core/styles';
import { required } from 'ra-core';
import React from 'react';
import { RadioButtonGroupInput, TextInput } from 'react-admin';
import { SimpleNestboxForm, NestboxEdit } from '../../../main/admin';
import styles from './styles';
import '@material-ui/icons/CheckCircle'; // <-- culprit

### Expected

import { withStyles } from '@material-ui/core/styles';
import '@material-ui/icons/CheckCircle';
import { required } from 'ra-core';
import React from 'react';
import { RadioButtonGroupInput, TextInput } from 'react-admin';
import { NestboxEdit, SimpleNestboxForm } from '../../../main/admin';
import styles from './styles';

I obtain the correct sorting by invoking `VSCode` `Organize imports`

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported ordering with the shown import/order configuration and imports, then trace the import/order rule entry point that classifies the scoped package import. Done means the side-effect import from @material-ui/icons/CheckCircle is placed with external imports in the expected order, without regressing the other groups.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.