Skip to content

Commit f772f1a

Browse files
committed
feat: add import/consistent-type-specifier-style rule
1 parent b425a69 commit f772f1a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/configs/imports.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export function imports(): TypedFlatConfigItem[] {
1414
'antfu/no-import-dist': 'error',
1515
'antfu/no-import-node-modules-by-path': 'error',
1616

17+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
1718
'import/first': 'error',
1819
'import/no-duplicates': 'error',
1920
'import/no-mutable-exports': 'error',

src/configs/typescript.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ export async function typescript(
141141
'ts/consistent-type-definitions': ['error', 'interface'],
142142
'ts/consistent-type-imports': [
143143
'error',
144-
{ disallowTypeAnnotations: false, prefer: 'type-imports' },
144+
{
145+
disallowTypeAnnotations: false,
146+
fixStyle: 'separate-type-imports',
147+
prefer: 'type-imports',
148+
},
145149
],
146150
'ts/method-signature-style': ['error', 'property'], // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
147151
'ts/no-dupe-class-members': 'error',

0 commit comments

Comments
 (0)