Reputation: 841
I just can't find anything on how to configure this, if it's possible. In this example, I want the type
imports grouped together. The docs indicate it's possible but I get errors about no more config options allowed. Ideally it would sort both:
import type {a,b,c}` and `import {type a, type b, type c}
After lint --fix
import {
type QueryKey,
queryOptions,
useQueries,
useQuery,
type UseQueryOptions,
} from '@tanstack/react-query';
expected sorting
import {
queryOptions,
useQueries,
useQuery,
type QueryKey,
type UseQueryOptions,
} from '@tanstack/react-query';
eslintrc file
'error',
{
ignoreCase: true,
ignoreDeclarationSort: false,
allowSeparatedGroups: true,
},
],
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
pathGroups: [{ pattern: '~/**', group: 'internal', position: 'after' }],
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
},
],
Upvotes: 0
Views: 49