-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[import/order] "import type" always should be recognized as 'type' group #2088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please check in the newly released v2.23.3 (#2092). |
@ljharb not helped |
@Bardiamist using the following option would prevent type imports being handled by
|
@grit96 no, that not helped |
The following test passes successfully with the latest plugin version using the config and code you provided plus the option I mentioned above: test(
{
code: `
import type { ViewStyle, TextStyle } from 'react-native';
import type { Color } from '~/enums';
`,
parser,
options: [
{
'newlines-between': 'always',
'groups': [
'type',
'external',
'builtin',
'parent',
'object',
'sibling',
],
'pathGroups': [
{
'pattern': '~/types/**',
'group': 'type',
},
{
'pattern': '**/types',
'group': 'type',
},
{
'pattern': '~/**',
'group': 'builtin',
},
],
'pathGroupsExcludedImportTypes': ['type'],
},
],
},
parserConfig,
), |
I'm not sure why that not applied at first time (tried twice). It realy working nice now. Thank you |
Problem
should be recognized as
type
.If
import type
then don't need to usepathGroups
. Becuase sometimes I can useRouteName
as value, sometomes only as type. Thenimport type
keywords must take precedence on group recognition.Full rules
The text was updated successfully, but these errors were encountered: