import-js/eslint-plugin-import
View on GitHub[import/order] control over fix newlines
Open
#2391 opened on Mar 1, 2022
enhancementhelp wantedimport/export ordering
Description
With import/order, when using 'newlines-between': 'always-and-inside-groups' there seems to be no way to control how the fix happens.
Example problem:
import AddressTextField from './AddressTextField'
import CityField from './CityField'
import ContentLoader from 'components/ContentLoader/ContentLoader'
import SeparatedList from 'components/SeparatedList/SeparatedList'
Fix result:
import ContentLoader from 'components/ContentLoader/ContentLoader'
import SeparatedList from 'components/SeparatedList/SeparatedList'
import AddressTextField from './AddressTextField'
import CityField from './CityField'
Desired result:
import ContentLoader from 'components/ContentLoader/ContentLoader'
import SeparatedList from 'components/SeparatedList/SeparatedList'
import AddressTextField from './AddressTextField'
import CityField from './CityField'
Any chance to add support for some control over this?
Possible ways to control:
- inference from the surrounding imports in the file, fallbacking to current behavior
- additional property, accepting arbitrary grouping/spacing logic, likely related to https://github.com/import-js/eslint-plugin-import/issues/2292