import-js / import-js/eslint-plugin-import
Scoped package @org/package ignored by import/order
- 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
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