diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index c15795773a0..890e6b04aa5 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -108,6 +108,7 @@ export default util.createRule({ AST_NODE_TYPES.TSArrayType, AST_NODE_TYPES.TSTypeReference, AST_NODE_TYPES.TSLiteralType, + AST_NODE_TYPES.TSTypeQuery, ]; type CompositionType = TSESTree.TSUnionType | TSESTree.TSIntersectionType; diff --git a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts index df42dd0f082..d34cb9957b8 100644 --- a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts @@ -364,6 +364,14 @@ type Foo = { }, ], }, + { + code: 'type Foo = typeof bar;', + options: [{ allowAliases: 'always' }], + }, + { + code: 'type Foo = typeof bar | typeof baz;', + options: [{ allowAliases: 'in-unions' }], + }, ], invalid: [ {