import-js/eslint-plugin-import
Vedi su GitHub[import/order] control over fix newlines
Open
#2391 aperta il 1 mar 2022
enhancementhelp wantedimport/export ordering
Metriche repository
- Star
- (4946 star)
- Metriche merge PR
- (Merge medio 138g 22h) (3 PR mergiate in 30 g)
Descrizione
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