diff --git a/config/typescript.js b/config/typescript.js index 52ca9f5b35..55f2b7e897 100644 --- a/config/typescript.js +++ b/config/typescript.js @@ -2,7 +2,7 @@ * Adds `.jsx`, `.ts` and `.tsx` as an extension, and enables JSX/TSX parsing. */ -const allExtensions = ['.ts', '.tsx', '.d.ts', '.js', '.jsx']; +const allExtensions = ['.ts', '.tsx', '.js', '.jsx']; module.exports = { @@ -24,6 +24,5 @@ module.exports = { // TypeScript compilation already ensures that named imports exist in the referenced module 'import/named': 'off', - 'import/no-unresolved': 'off', }, }; diff --git a/src/rules/no-unresolved.js b/src/rules/no-unresolved.js index 236692b6e1..98539a822d 100644 --- a/src/rules/no-unresolved.js +++ b/src/rules/no-unresolved.js @@ -24,6 +24,11 @@ module.exports = { create(context) { function checkSourceValue(source) { + // ignore type-only imports + if (source.parent.importKind === 'type') { + return; + } + const shouldCheckCase = !CASE_SENSITIVE_FS && (!context.options[0] || context.options[0].caseSensitive !== false);