diff --git a/packages/eslint-plugin/src/util/types.ts b/packages/eslint-plugin/src/util/types.ts index 924c68e151d..f602a1e6a27 100644 --- a/packages/eslint-plugin/src/util/types.ts +++ b/packages/eslint-plugin/src/util/types.ts @@ -323,7 +323,12 @@ export function isAnyOrAnyArrayTypeDiscriminated( } if ( checker.isArrayType(type) && - isTypeAnyType(checker.getTypeArguments(type)[0]) + isTypeAnyType( + // getTypeArguments was only added in TS3.7 + checker.getTypeArguments + ? checker.getTypeArguments(type)[0] + : (type.typeArguments ?? [])[0], + ) ) { return AnyType.AnyArray; }