diff --git a/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.test.ts b/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.test.ts index f2e92fb..c4d93c2 100644 --- a/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.test.ts +++ b/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.test.ts @@ -6,6 +6,7 @@ const valids = [ 'import { type Foo } from \'foo\'', 'import type Foo from \'foo\'', 'import type * as Foo from \'foo\'', + 'import type {} from \'foo\'', ] const invalids = [ ['import type { Foo } from \'foo\'', 'import { type Foo } from \'foo\''], diff --git a/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts b/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts index 857cb49..219a750 100644 --- a/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts +++ b/packages/eslint-plugin-antfu/src/rules/prefer-inline-type-import.ts @@ -30,7 +30,7 @@ export default createEslintRule({ // ignore bare type imports if (node.specifiers.length === 1 && ['ImportNamespaceSpecifier', 'ImportDefaultSpecifier'].includes(node.specifiers[0].type)) return - if (node.importKind === 'type') { + if (node.importKind === 'type' && node.specifiers.length > 0) { context.report({ *fix(fixer) { yield * removeTypeSpecifier(fixer, sourceCode, node)