Closed
Description
We have a bit of a complex import/order
config and are seeing some new weird behavior with ordering on the sibling
and parent
groups on eslint-plugin-import@2.27.4
:
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
groups: ['type', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
'newlines-between': 'always',
pathGroups: [
{ pattern: '@Hub', group: 'external', position: 'after' },
{ pattern: '@Hub/**', group: 'external', position: 'after' },
{ pattern: '@Dash/**', group: 'external', position: 'after' },
{ pattern: '@core/**', group: 'external', position: 'after' },
{ pattern: '@routes/**', group: 'external', position: 'after' },
{ pattern: '@ui', group: 'external', position: 'after' },
{ pattern: '@ui/**', group: 'external', position: 'after' },
],
pathGroupsExcludedImportTypes: ['@Hub', '@Dash', '@core', '@routes', '@ui'],
warnOnUnassignedImports: true,
},
],
Here's what our code looks like on eslint-plugin-import@2.26.0
:
import React from 'react';
import Flex from '@ui/Flex';
import Menu, { MenuItem, MenuDivider } from '@ui/Menu';
import { isPolymorphic } from '../../utils';
import classes from './style.module.scss';
import './style.scss';
And it wants it to be now:
import React from 'react';
import Flex from '@ui/Flex';
import Menu, { MenuItem, MenuDivider } from '@ui/Menu';
import classes from './style.module.scss';
import './style.scss';
import { isPolymorphic } from '../../utils';
However if I swap the the order of parent
and sibling
in the config to this then the behavior we were seeing on v2.26.0 remains:
groups: ['type', 'builtin', 'external', 'internal', 'sibling', 'parent', 'index', 'object']
Metadata
Metadata
Assignees
Labels
No labels