diff --git a/src/rules/no-duplicates.js b/src/rules/no-duplicates.js index 33e68b1d37..b896f442ae 100644 --- a/src/rules/no-duplicates.js +++ b/src/rules/no-duplicates.js @@ -113,6 +113,7 @@ function getFix(first, rest, sourceCode, context) { const isTypeSpecifier = specifier.importNode.importKind === 'type'; const preferInline = context.options[0] && context.options[0]['prefer-inline']; + // a user might set prefer-inline but not have a supporting TypeScript version. Flow does not support inline types so this should fail in that case as well. if (preferInline && !semver.satisfies(typescriptPkg.version, '>= 4.5')) { throw new Error('Your version of TypeScript does not support inline type imports.'); }