diff --git a/src/rules/named.js b/src/rules/named.js index 8c2acd714..3a9180a6a 100644 --- a/src/rules/named.js +++ b/src/rules/named.js @@ -28,7 +28,7 @@ module.exports = { } node.specifiers.forEach(function (im) { - if (im.type !== type) return + if (im.type !== type || im.importKind === 'type') return const deepLookup = imports.hasDeep(im[key].name) diff --git a/tests/src/rules/named.js b/tests/src/rules/named.js index 4fdd3434f..ceca1ec9c 100644 --- a/tests/src/rules/named.js +++ b/tests/src/rules/named.js @@ -72,6 +72,11 @@ ruleTester.run('named', rule, { code: 'import type { MissingType } from "./flowtypes"', parser: 'babel-eslint', }), + + test({ + code: 'import { type MissingType } from "./flowtypes"', + parser: 'babel-eslint', + }), // TypeScript test({