From 415a123d6ecf03a0010903d880bc03d3dd5f50b4 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 31 Dec 2024 12:07:15 +0100 Subject: [PATCH] fix: consistent-type-imports --- eslint.config.mjs | 1 + factory/formatter.ts | 6 +++--- factory/generator.ts | 3 ++- src/AnnotationsReader.ts | 4 ++-- .../BasicAnnotationsReader.ts | 6 +++--- .../ExtendedAnnotationsReader.ts | 4 ++-- src/CircularReferenceNodeParser.ts | 8 ++++---- src/CircularReferenceTypeFormatter.ts | 6 +++--- src/ExposeNodeParser.ts | 8 ++++---- src/Interfaces/AnnotationsReader.ts | 4 ++-- src/Interfaces/MutableParser.ts | 2 +- src/Interfaces/MutableTypeFormatter.ts | 2 +- src/Interfaces/SubNodeParser.ts | 4 ++-- src/Interfaces/SubTypeFormatter.ts | 4 ++-- src/Interfaces/TypeFormatter.ts | 4 ++-- src/MutableParser.ts | 2 +- src/MutableTypeFormatter.ts | 2 +- src/NodeParser.ts | 6 +++--- src/NodeParser/AnnotatedNodeParser.ts | 10 +++++----- src/NodeParser/AnyTypeNodeParser.ts | 6 +++--- .../ArrayLiteralExpressionNodeParser.ts | 6 +++--- src/NodeParser/AsExpressionNodeParser.ts | 8 ++++---- src/NodeParser/BooleanLiteralNodeParser.ts | 6 +++--- src/NodeParser/BooleanTypeNodeParser.ts | 6 +++--- src/NodeParser/CallExpressionParser.ts | 7 ++++--- src/NodeParser/ConditionalTypeNodeParser.ts | 7 ++++--- src/NodeParser/ConstructorNodeParser.ts | 8 ++++---- src/NodeParser/EnumNodeParser.ts | 9 +++++---- .../ExpressionWithTypeArgumentsNodeParser.ts | 7 ++++--- src/NodeParser/HiddenTypeNodeParser.ts | 8 ++++---- src/NodeParser/InferTypeNodeParser.ts | 6 +++--- src/NodeParser/InterfaceAndClassNodeParser.ts | 11 ++++++----- src/NodeParser/LiteralNodeParser.ts | 6 +++--- src/NodeParser/MappedTypeNodeParser.ts | 10 ++++++---- src/NodeParser/NamedTupleMemberNodeParser.ts | 8 ++++---- src/NodeParser/NeverTypeNodeParser.ts | 6 +++--- src/NodeParser/NullLiteralNodeParser.ts | 6 +++--- src/NodeParser/NumberLiteralNodeParser.ts | 6 +++--- src/NodeParser/NumberTypeNodeParser.ts | 6 +++--- src/NodeParser/ObjectTypeNodeParser.ts | 6 +++--- src/NodeParser/OptionalTypeNodeParser.ts | 6 +++--- src/NodeParser/ParameterParser.ts | 8 ++++---- src/NodeParser/ParenthesizedNodeParser.ts | 6 +++--- .../PropertyAccessExpressionParser.ts | 6 +++--- src/NodeParser/RestTypeNodeParser.ts | 12 ++++++------ src/NodeParser/SatisfiesNodeParser.ts | 6 +++--- src/NodeParser/StringLiteralNodeParser.ts | 6 +++--- src/NodeParser/StringTypeNodeParser.ts | 6 +++--- src/NodeParser/SymbolTypeNodeParser.ts | 6 +++--- src/NodeParser/TupleNodeParser.ts | 6 +++--- src/NodeParser/TypeAliasNodeParser.ts | 8 ++++---- src/NodeParser/TypeLiteralNodeParser.ts | 11 ++++++----- src/NodeParser/TypeOperatorNodeParser.ts | 6 +++--- src/NodeParser/UndefinedLiteralNodeParser.ts | 6 +++--- src/NodeParser/UndefinedTypeNodeParser.ts | 6 +++--- src/NodeParser/UnionNodeParser.ts | 6 +++--- src/NodeParser/UnknownTypeNodeParser.ts | 6 +++--- src/NodeParser/VoidTypeNodeParser.ts | 6 +++--- src/Schema/Definition.ts | 2 +- src/Schema/RawType.ts | 2 +- src/Schema/Schema.ts | 2 +- src/SubNodeParser.ts | 4 ++-- src/SubTypeFormatter.ts | 4 ++-- src/TopRefNodeParser.ts | 6 +++--- src/Type/ConstructorType.ts | 4 ++-- src/Type/FunctionType.ts | 4 ++-- src/Type/RestType.ts | 6 +++--- src/Type/TupleType.ts | 4 ++-- src/TypeFormatter.ts | 4 ++-- src/TypeFormatter/AliasTypeFormatter.ts | 8 ++++---- src/TypeFormatter/AnyTypeFormatter.ts | 6 +++--- src/TypeFormatter/ArrayTypeFormatter.ts | 8 ++++---- src/TypeFormatter/BooleanTypeFormatter.ts | 6 +++--- src/TypeFormatter/ConstructorTypeFormatter.ts | 2 +- src/TypeFormatter/DefinitionTypeFormatter.ts | 8 ++++---- src/TypeFormatter/EnumTypeFormatter.ts | 6 +++--- src/TypeFormatter/FunctionTypeFormatter.ts | 10 +++++----- src/TypeFormatter/HiddenTypeFormatter.ts | 6 +++--- src/TypeFormatter/IntersectionTypeFormatter.ts | 8 ++++---- src/TypeFormatter/LiteralTypeFormatter.ts | 6 +++--- src/TypeFormatter/LiteralUnionTypeFormatter.ts | 11 ++++++----- src/TypeFormatter/NeverTypeFormatter.ts | 6 +++--- src/TypeFormatter/NullTypeFormatter.ts | 6 +++--- src/TypeFormatter/NumberTypeFormatter.ts | 6 +++--- src/TypeFormatter/ObjectTypeFormatter.ts | 8 ++++---- src/TypeFormatter/OptionalTypeFormatter.ts | 8 ++++---- src/TypeFormatter/ReferenceTypeFormatter.ts | 8 ++++---- src/TypeFormatter/RestTypeFormatter.ts | 8 ++++---- src/TypeFormatter/StringTypeFormatter.ts | 6 +++--- src/TypeFormatter/SymbolTypeFormatter.ts | 6 +++--- src/TypeFormatter/TupleTypeFormatter.ts | 8 ++++---- src/TypeFormatter/UndefinedTypeFormatter.ts | 6 +++--- src/TypeFormatter/UnionTypeFormatter.ts | 10 +++++----- src/TypeFormatter/UnknownTypeFormatter.ts | 6 +++--- src/TypeFormatter/VoidTypeFormatter.ts | 6 +++--- src/Utils/allOfDefinition.ts | 8 ++++---- src/Utils/deepMerge.ts | 6 +++--- src/Utils/derefType.ts | 2 +- src/Utils/hasJsDocTag.ts | 2 +- src/Utils/isAssignableTo.ts | 8 +++++--- src/Utils/isHidden.ts | 2 +- src/Utils/narrowType.ts | 2 +- src/Utils/nodeKey.ts | 4 ++-- src/Utils/notNever.ts | 2 +- src/Utils/preserveAnnotation.ts | 2 +- src/Utils/removeUndefined.ts | 2 +- src/Utils/typeKeys.ts | 2 +- src/Utils/uniqueTypeArray.ts | 2 +- test/config.test.ts | 18 +++++++++++------- test/invalid-data.test.ts | 5 +++-- test/utils.ts | 8 +++++--- test/vega-lite.test.ts | 3 ++- 112 files changed, 341 insertions(+), 320 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 5f945808a..804688655 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -30,6 +30,7 @@ export default tseslint.config( rules: { "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/prefer-for-of": "error", "@typescript-eslint/no-require-imports": "error", "@typescript-eslint/no-parameter-properties": "off", diff --git a/factory/formatter.ts b/factory/formatter.ts index b77a9b954..164b0a4f2 100644 --- a/factory/formatter.ts +++ b/factory/formatter.ts @@ -1,8 +1,8 @@ import { ChainTypeFormatter } from "../src/ChainTypeFormatter.js"; import { CircularReferenceTypeFormatter } from "../src/CircularReferenceTypeFormatter.js"; -import { CompletedConfig } from "../src/Config.js"; -import { MutableTypeFormatter } from "../src/MutableTypeFormatter.js"; -import { TypeFormatter } from "../src/TypeFormatter.js"; +import type { CompletedConfig } from "../src/Config.js"; +import type { MutableTypeFormatter } from "../src/MutableTypeFormatter.js"; +import type { TypeFormatter } from "../src/TypeFormatter.js"; import { AliasTypeFormatter } from "../src/TypeFormatter/AliasTypeFormatter.js"; import { AnnotatedTypeFormatter } from "../src/TypeFormatter/AnnotatedTypeFormatter.js"; import { AnyTypeFormatter } from "../src/TypeFormatter/AnyTypeFormatter.js"; diff --git a/factory/generator.ts b/factory/generator.ts index bf54919b4..c05013fcf 100644 --- a/factory/generator.ts +++ b/factory/generator.ts @@ -1,4 +1,5 @@ -import { Config, DEFAULT_CONFIG } from "../src/Config.js"; +import type { Config } from "../src/Config.js"; +import { DEFAULT_CONFIG } from "../src/Config.js"; import { SchemaGenerator } from "../src/SchemaGenerator.js"; import { createFormatter } from "./formatter.js"; import { createParser } from "./parser.js"; diff --git a/src/AnnotationsReader.ts b/src/AnnotationsReader.ts index 97235860d..7f77271c1 100644 --- a/src/AnnotationsReader.ts +++ b/src/AnnotationsReader.ts @@ -1,5 +1,5 @@ -import ts from "typescript"; -import { Annotations } from "./Type/AnnotatedType.js"; +import type ts from "typescript"; +import type { Annotations } from "./Type/AnnotatedType.js"; export interface AnnotationsReader { getAnnotations(node: ts.Node): Annotations | undefined; diff --git a/src/AnnotationsReader/BasicAnnotationsReader.ts b/src/AnnotationsReader/BasicAnnotationsReader.ts index 3b6969ed1..a760cf18e 100644 --- a/src/AnnotationsReader/BasicAnnotationsReader.ts +++ b/src/AnnotationsReader/BasicAnnotationsReader.ts @@ -1,7 +1,7 @@ import json5 from "json5"; -import ts from "typescript"; -import { AnnotationsReader } from "../AnnotationsReader.js"; -import { Annotations } from "../Type/AnnotatedType.js"; +import type ts from "typescript"; +import type { AnnotationsReader } from "../AnnotationsReader.js"; +import type { Annotations } from "../Type/AnnotatedType.js"; import { symbolAtNode } from "../Utils/symbolAtNode.js"; export class BasicAnnotationsReader implements AnnotationsReader { diff --git a/src/AnnotationsReader/ExtendedAnnotationsReader.ts b/src/AnnotationsReader/ExtendedAnnotationsReader.ts index dba92bf89..9e2a292ff 100644 --- a/src/AnnotationsReader/ExtendedAnnotationsReader.ts +++ b/src/AnnotationsReader/ExtendedAnnotationsReader.ts @@ -1,6 +1,6 @@ import json5 from "json5"; -import ts from "typescript"; -import { Annotations } from "../Type/AnnotatedType.js"; +import type ts from "typescript"; +import type { Annotations } from "../Type/AnnotatedType.js"; import { symbolAtNode } from "../Utils/symbolAtNode.js"; import { BasicAnnotationsReader } from "./BasicAnnotationsReader.js"; diff --git a/src/CircularReferenceNodeParser.ts b/src/CircularReferenceNodeParser.ts index 88244d5f5..7173939d4 100644 --- a/src/CircularReferenceNodeParser.ts +++ b/src/CircularReferenceNodeParser.ts @@ -1,7 +1,7 @@ -import ts from "typescript"; -import { Context } from "./NodeParser.js"; -import { SubNodeParser } from "./SubNodeParser.js"; -import { BaseType } from "./Type/BaseType.js"; +import type ts from "typescript"; +import type { Context } from "./NodeParser.js"; +import type { SubNodeParser } from "./SubNodeParser.js"; +import type { BaseType } from "./Type/BaseType.js"; import { ReferenceType } from "./Type/ReferenceType.js"; import { getKey } from "./Utils/nodeKey.js"; diff --git a/src/CircularReferenceTypeFormatter.ts b/src/CircularReferenceTypeFormatter.ts index 58856377d..ddce8328d 100644 --- a/src/CircularReferenceTypeFormatter.ts +++ b/src/CircularReferenceTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "./Schema/Definition.js"; -import { SubTypeFormatter } from "./SubTypeFormatter.js"; -import { BaseType } from "./Type/BaseType.js"; +import type { Definition } from "./Schema/Definition.js"; +import type { SubTypeFormatter } from "./SubTypeFormatter.js"; +import type { BaseType } from "./Type/BaseType.js"; import { uniqueArray } from "./Utils/uniqueArray.js"; export class CircularReferenceTypeFormatter implements SubTypeFormatter { diff --git a/src/ExposeNodeParser.ts b/src/ExposeNodeParser.ts index baa9ea5b4..171a67d5f 100644 --- a/src/ExposeNodeParser.ts +++ b/src/ExposeNodeParser.ts @@ -1,9 +1,9 @@ import ts from "typescript"; -import { Context } from "./NodeParser.js"; -import { SubNodeParser } from "./SubNodeParser.js"; -import { BaseType } from "./Type/BaseType.js"; +import type { Context } from "./NodeParser.js"; +import type { SubNodeParser } from "./SubNodeParser.js"; +import type { BaseType } from "./Type/BaseType.js"; import { DefinitionType } from "./Type/DefinitionType.js"; -import { ReferenceType } from "./Type/ReferenceType.js"; +import type { ReferenceType } from "./Type/ReferenceType.js"; import { hasJsDocTag } from "./Utils/hasJsDocTag.js"; import { symbolAtNode } from "./Utils/symbolAtNode.js"; diff --git a/src/Interfaces/AnnotationsReader.ts b/src/Interfaces/AnnotationsReader.ts index ec9aa89cb..995b591ab 100755 --- a/src/Interfaces/AnnotationsReader.ts +++ b/src/Interfaces/AnnotationsReader.ts @@ -1,5 +1,5 @@ -import ts from "typescript"; -import { Annotations } from "../Type/AnnotatedType.js"; +import type ts from "typescript"; +import type { Annotations } from "../Type/AnnotatedType.js"; export interface AnnotationsReader { getAnnotations(node: ts.Node): Annotations | undefined; diff --git a/src/Interfaces/MutableParser.ts b/src/Interfaces/MutableParser.ts index 56eed1d34..9f071fd17 100755 --- a/src/Interfaces/MutableParser.ts +++ b/src/Interfaces/MutableParser.ts @@ -1,4 +1,4 @@ -import { SubNodeParser } from "./SubNodeParser.js"; +import type { SubNodeParser } from "./SubNodeParser.js"; export interface MutableParser { addNodeParser(parser: SubNodeParser): MutableParser; diff --git a/src/Interfaces/MutableTypeFormatter.ts b/src/Interfaces/MutableTypeFormatter.ts index ded6bd583..7f8e3a540 100755 --- a/src/Interfaces/MutableTypeFormatter.ts +++ b/src/Interfaces/MutableTypeFormatter.ts @@ -1,4 +1,4 @@ -import { SubTypeFormatter } from "./SubTypeFormatter.js"; +import type { SubTypeFormatter } from "./SubTypeFormatter.js"; export interface MutableTypeFormatter { addTypeFormatter(formatter: SubTypeFormatter): MutableTypeFormatter; diff --git a/src/Interfaces/SubNodeParser.ts b/src/Interfaces/SubNodeParser.ts index df0685150..c7de0c0e0 100755 --- a/src/Interfaces/SubNodeParser.ts +++ b/src/Interfaces/SubNodeParser.ts @@ -1,5 +1,5 @@ -import ts from "typescript"; -import { NodeParser } from "../NodeParser.js"; +import type ts from "typescript"; +import type { NodeParser } from "../NodeParser.js"; export interface SubNodeParser extends NodeParser { supportsNode(node: ts.Node): boolean; diff --git a/src/Interfaces/SubTypeFormatter.ts b/src/Interfaces/SubTypeFormatter.ts index 2134e5aab..7e5cfdaaf 100755 --- a/src/Interfaces/SubTypeFormatter.ts +++ b/src/Interfaces/SubTypeFormatter.ts @@ -1,5 +1,5 @@ -import { BaseType } from "../Type/BaseType.js"; -import { TypeFormatter } from "./TypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { TypeFormatter } from "./TypeFormatter.js"; export interface SubTypeFormatter extends TypeFormatter { supportsType(type: BaseType): boolean; diff --git a/src/Interfaces/TypeFormatter.ts b/src/Interfaces/TypeFormatter.ts index 0eff45122..2be839f38 100755 --- a/src/Interfaces/TypeFormatter.ts +++ b/src/Interfaces/TypeFormatter.ts @@ -1,5 +1,5 @@ -import { Definition } from "../Schema/Definition.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { BaseType } from "../Type/BaseType.js"; export interface TypeFormatter { getDefinition(type: BaseType): Definition; diff --git a/src/MutableParser.ts b/src/MutableParser.ts index 56eed1d34..9f071fd17 100644 --- a/src/MutableParser.ts +++ b/src/MutableParser.ts @@ -1,4 +1,4 @@ -import { SubNodeParser } from "./SubNodeParser.js"; +import type { SubNodeParser } from "./SubNodeParser.js"; export interface MutableParser { addNodeParser(parser: SubNodeParser): MutableParser; diff --git a/src/MutableTypeFormatter.ts b/src/MutableTypeFormatter.ts index ded6bd583..7f8e3a540 100644 --- a/src/MutableTypeFormatter.ts +++ b/src/MutableTypeFormatter.ts @@ -1,4 +1,4 @@ -import { SubTypeFormatter } from "./SubTypeFormatter.js"; +import type { SubTypeFormatter } from "./SubTypeFormatter.js"; export interface MutableTypeFormatter { addTypeFormatter(formatter: SubTypeFormatter): MutableTypeFormatter; diff --git a/src/NodeParser.ts b/src/NodeParser.ts index b9f944dc3..6fc3f225a 100644 --- a/src/NodeParser.ts +++ b/src/NodeParser.ts @@ -1,7 +1,7 @@ import stringify from "safe-stable-stringify"; -import ts from "typescript"; -import { BaseType } from "./Type/BaseType.js"; -import { ReferenceType } from "./Type/ReferenceType.js"; +import type ts from "typescript"; +import type { BaseType } from "./Type/BaseType.js"; +import type { ReferenceType } from "./Type/ReferenceType.js"; import { getKey } from "./Utils/nodeKey.js"; export class Context { diff --git a/src/NodeParser/AnnotatedNodeParser.ts b/src/NodeParser/AnnotatedNodeParser.ts index f803aea21..7592237dc 100644 --- a/src/NodeParser/AnnotatedNodeParser.ts +++ b/src/NodeParser/AnnotatedNodeParser.ts @@ -1,11 +1,11 @@ import ts from "typescript"; -import { AnnotationsReader } from "../AnnotationsReader.js"; +import type { AnnotationsReader } from "../AnnotationsReader.js"; import { ExtendedAnnotationsReader } from "../AnnotationsReader/ExtendedAnnotationsReader.js"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { AnnotatedType } from "../Type/AnnotatedType.js"; -import { BaseType } from "../Type/BaseType.js"; -import { ReferenceType } from "../Type/ReferenceType.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { ReferenceType } from "../Type/ReferenceType.js"; import { removeUndefined } from "../Utils/removeUndefined.js"; import { DefinitionType } from "../Type/DefinitionType.js"; import { UnionType } from "../Type/UnionType.js"; diff --git a/src/NodeParser/AnyTypeNodeParser.ts b/src/NodeParser/AnyTypeNodeParser.ts index 0cb881384..95f1fd05a 100644 --- a/src/NodeParser/AnyTypeNodeParser.ts +++ b/src/NodeParser/AnyTypeNodeParser.ts @@ -1,8 +1,8 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { AnyType } from "../Type/AnyType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; export class AnyTypeNodeParser implements SubNodeParser { public supportsNode(node: ts.KeywordTypeNode): boolean { diff --git a/src/NodeParser/ArrayLiteralExpressionNodeParser.ts b/src/NodeParser/ArrayLiteralExpressionNodeParser.ts index 0b22b7975..08e9538aa 100644 --- a/src/NodeParser/ArrayLiteralExpressionNodeParser.ts +++ b/src/NodeParser/ArrayLiteralExpressionNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { TupleType } from "../Type/TupleType.js"; export class ArrayLiteralExpressionNodeParser implements SubNodeParser { diff --git a/src/NodeParser/AsExpressionNodeParser.ts b/src/NodeParser/AsExpressionNodeParser.ts index 68222bdda..f8f57b818 100644 --- a/src/NodeParser/AsExpressionNodeParser.ts +++ b/src/NodeParser/AsExpressionNodeParser.ts @@ -1,8 +1,8 @@ -import { NodeParser } from "../NodeParser.js"; +import type { NodeParser } from "../NodeParser.js"; import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class AsExpressionNodeParser implements SubNodeParser { public constructor(protected childNodeParser: NodeParser) {} diff --git a/src/NodeParser/BooleanLiteralNodeParser.ts b/src/NodeParser/BooleanLiteralNodeParser.ts index ca1c39c30..7f732ca46 100644 --- a/src/NodeParser/BooleanLiteralNodeParser.ts +++ b/src/NodeParser/BooleanLiteralNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { LiteralType } from "../Type/LiteralType.js"; export class BooleanLiteralNodeParser implements SubNodeParser { diff --git a/src/NodeParser/BooleanTypeNodeParser.ts b/src/NodeParser/BooleanTypeNodeParser.ts index 718172d49..de61a30b3 100644 --- a/src/NodeParser/BooleanTypeNodeParser.ts +++ b/src/NodeParser/BooleanTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { BooleanType } from "../Type/BooleanType.js"; export class BooleanTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/CallExpressionParser.ts b/src/NodeParser/CallExpressionParser.ts index 71d98009d..a59a03c3d 100644 --- a/src/NodeParser/CallExpressionParser.ts +++ b/src/NodeParser/CallExpressionParser.ts @@ -1,8 +1,9 @@ import { TupleType } from "../Type/TupleType.js"; import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { NodeParser } from "../NodeParser.js"; +import { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { UnionType } from "../Type/UnionType.js"; import { LiteralType } from "../Type/LiteralType.js"; import { SymbolType } from "../Type/SymbolType.js"; diff --git a/src/NodeParser/ConditionalTypeNodeParser.ts b/src/NodeParser/ConditionalTypeNodeParser.ts index 6e05b1bd2..64ca30fe8 100644 --- a/src/NodeParser/ConditionalTypeNodeParser.ts +++ b/src/NodeParser/ConditionalTypeNodeParser.ts @@ -1,7 +1,8 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { NodeParser } from "../NodeParser.js"; +import { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { isAssignableTo } from "../Utils/isAssignableTo.js"; import { narrowType } from "../Utils/narrowType.js"; import { UnionType } from "../Type/UnionType.js"; diff --git a/src/NodeParser/ConstructorNodeParser.ts b/src/NodeParser/ConstructorNodeParser.ts index 4376903bc..338c2e3c2 100644 --- a/src/NodeParser/ConstructorNodeParser.ts +++ b/src/NodeParser/ConstructorNodeParser.ts @@ -1,10 +1,10 @@ import ts from "typescript"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { ConstructorType } from "../Type/ConstructorType.js"; -import { FunctionOptions } from "../Config.js"; +import type { FunctionOptions } from "../Config.js"; import { NeverType } from "../Type/NeverType.js"; -import { Context, NodeParser } from "../NodeParser.js"; +import type { Context, NodeParser } from "../NodeParser.js"; import { DefinitionType } from "../Type/DefinitionType.js"; import { getNamedArguments, getTypeName } from "./FunctionNodeParser.js"; diff --git a/src/NodeParser/EnumNodeParser.ts b/src/NodeParser/EnumNodeParser.ts index a23a3a49c..406e1723a 100644 --- a/src/NodeParser/EnumNodeParser.ts +++ b/src/NodeParser/EnumNodeParser.ts @@ -1,8 +1,9 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; -import { EnumType, EnumValue } from "../Type/EnumType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { EnumValue } from "../Type/EnumType.js"; +import { EnumType } from "../Type/EnumType.js"; import { isNodeHidden } from "../Utils/isHidden.js"; import { getKey } from "../Utils/nodeKey.js"; diff --git a/src/NodeParser/ExpressionWithTypeArgumentsNodeParser.ts b/src/NodeParser/ExpressionWithTypeArgumentsNodeParser.ts index b7e382166..020888603 100644 --- a/src/NodeParser/ExpressionWithTypeArgumentsNodeParser.ts +++ b/src/NodeParser/ExpressionWithTypeArgumentsNodeParser.ts @@ -1,7 +1,8 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { NodeParser } from "../NodeParser.js"; +import { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class ExpressionWithTypeArgumentsNodeParser implements SubNodeParser { public constructor( diff --git a/src/NodeParser/HiddenTypeNodeParser.ts b/src/NodeParser/HiddenTypeNodeParser.ts index 681cb35bf..b0df5e406 100644 --- a/src/NodeParser/HiddenTypeNodeParser.ts +++ b/src/NodeParser/HiddenTypeNodeParser.ts @@ -1,7 +1,7 @@ -import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type ts from "typescript"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { HiddenType } from "../Type/HiddenType.js"; import { isNodeHidden } from "../Utils/isHidden.js"; diff --git a/src/NodeParser/InferTypeNodeParser.ts b/src/NodeParser/InferTypeNodeParser.ts index 141ea9b5b..15ad3914a 100644 --- a/src/NodeParser/InferTypeNodeParser.ts +++ b/src/NodeParser/InferTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { InferType } from "../Type/InferType.js"; export class InferTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/InterfaceAndClassNodeParser.ts b/src/NodeParser/InterfaceAndClassNodeParser.ts index cb8907abd..a3c54448b 100644 --- a/src/NodeParser/InterfaceAndClassNodeParser.ts +++ b/src/NodeParser/InterfaceAndClassNodeParser.ts @@ -1,11 +1,12 @@ -import ts, { PropertyName } from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { PropertyName } from "typescript"; +import ts from "typescript"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NeverType } from "../Type/NeverType.js"; import { ObjectProperty, ObjectType } from "../Type/ObjectType.js"; -import { ReferenceType } from "../Type/ReferenceType.js"; +import type { ReferenceType } from "../Type/ReferenceType.js"; import { isNodeHidden } from "../Utils/isHidden.js"; import { isPublic, isStatic } from "../Utils/modifiers.js"; import { getKey } from "../Utils/nodeKey.js"; diff --git a/src/NodeParser/LiteralNodeParser.ts b/src/NodeParser/LiteralNodeParser.ts index 31ea08dea..feafdbbae 100644 --- a/src/NodeParser/LiteralNodeParser.ts +++ b/src/NodeParser/LiteralNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class LiteralNodeParser implements SubNodeParser { public constructor(protected childNodeParser: NodeParser) {} diff --git a/src/NodeParser/MappedTypeNodeParser.ts b/src/NodeParser/MappedTypeNodeParser.ts index b0856521f..4a597d073 100644 --- a/src/NodeParser/MappedTypeNodeParser.ts +++ b/src/NodeParser/MappedTypeNodeParser.ts @@ -1,12 +1,14 @@ import ts from "typescript"; import { ExpectationFailedError } from "../Error/Errors.js"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { NodeParser } from "../NodeParser.js"; +import { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { AnnotatedType } from "../Type/AnnotatedType.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { DefinitionType } from "../Type/DefinitionType.js"; -import { EnumType, EnumValue } from "../Type/EnumType.js"; +import type { EnumValue } from "../Type/EnumType.js"; +import { EnumType } from "../Type/EnumType.js"; import { LiteralType } from "../Type/LiteralType.js"; import { NeverType } from "../Type/NeverType.js"; import { NumberType } from "../Type/NumberType.js"; diff --git a/src/NodeParser/NamedTupleMemberNodeParser.ts b/src/NodeParser/NamedTupleMemberNodeParser.ts index 168226196..4389a4c73 100644 --- a/src/NodeParser/NamedTupleMemberNodeParser.ts +++ b/src/NodeParser/NamedTupleMemberNodeParser.ts @@ -1,10 +1,10 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { AnnotatedType } from "../Type/AnnotatedType.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; -import { ReferenceType } from "../Type/ReferenceType.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { ReferenceType } from "../Type/ReferenceType.js"; import { RestType } from "../Type/RestType.js"; export class NamedTupleMemberNodeParser implements SubNodeParser { diff --git a/src/NodeParser/NeverTypeNodeParser.ts b/src/NodeParser/NeverTypeNodeParser.ts index 5c1f950a6..d18f6e107 100644 --- a/src/NodeParser/NeverTypeNodeParser.ts +++ b/src/NodeParser/NeverTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NeverType } from "../Type/NeverType.js"; export class NeverTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/NullLiteralNodeParser.ts b/src/NodeParser/NullLiteralNodeParser.ts index 9aa9f7d9d..411e1df6a 100644 --- a/src/NodeParser/NullLiteralNodeParser.ts +++ b/src/NodeParser/NullLiteralNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NullType } from "../Type/NullType.js"; export class NullLiteralNodeParser implements SubNodeParser { diff --git a/src/NodeParser/NumberLiteralNodeParser.ts b/src/NodeParser/NumberLiteralNodeParser.ts index 5d0214aa6..3a1750124 100644 --- a/src/NodeParser/NumberLiteralNodeParser.ts +++ b/src/NodeParser/NumberLiteralNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { LiteralType } from "../Type/LiteralType.js"; export class NumberLiteralNodeParser implements SubNodeParser { diff --git a/src/NodeParser/NumberTypeNodeParser.ts b/src/NodeParser/NumberTypeNodeParser.ts index 8ff6e201b..d26c2581c 100644 --- a/src/NodeParser/NumberTypeNodeParser.ts +++ b/src/NodeParser/NumberTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NumberType } from "../Type/NumberType.js"; export class NumberTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/ObjectTypeNodeParser.ts b/src/NodeParser/ObjectTypeNodeParser.ts index b2e796e71..f3a9b7633 100644 --- a/src/NodeParser/ObjectTypeNodeParser.ts +++ b/src/NodeParser/ObjectTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { ObjectType } from "../Type/ObjectType.js"; import { getKey } from "../Utils/nodeKey.js"; diff --git a/src/NodeParser/OptionalTypeNodeParser.ts b/src/NodeParser/OptionalTypeNodeParser.ts index 4eeab8c64..159c13b69 100644 --- a/src/NodeParser/OptionalTypeNodeParser.ts +++ b/src/NodeParser/OptionalTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { OptionalType } from "../Type/OptionalType.js"; export class OptionalTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/ParameterParser.ts b/src/NodeParser/ParameterParser.ts index bfb190727..edb05b192 100644 --- a/src/NodeParser/ParameterParser.ts +++ b/src/NodeParser/ParameterParser.ts @@ -1,8 +1,8 @@ import ts from "typescript"; -import { NodeParser } from "../NodeParser.js"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { NodeParser } from "../NodeParser.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class ParameterParser implements SubNodeParser { constructor(protected childNodeParser: NodeParser) {} diff --git a/src/NodeParser/ParenthesizedNodeParser.ts b/src/NodeParser/ParenthesizedNodeParser.ts index 5b83e965a..9126d186a 100644 --- a/src/NodeParser/ParenthesizedNodeParser.ts +++ b/src/NodeParser/ParenthesizedNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class ParenthesizedNodeParser implements SubNodeParser { public constructor(protected childNodeParser: NodeParser) {} diff --git a/src/NodeParser/PropertyAccessExpressionParser.ts b/src/NodeParser/PropertyAccessExpressionParser.ts index 2dec5c6bf..c9f4aef5a 100644 --- a/src/NodeParser/PropertyAccessExpressionParser.ts +++ b/src/NodeParser/PropertyAccessExpressionParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class PropertyAccessExpressionParser implements SubNodeParser { public constructor( diff --git a/src/NodeParser/RestTypeNodeParser.ts b/src/NodeParser/RestTypeNodeParser.ts index 0652f49b7..df854708f 100644 --- a/src/NodeParser/RestTypeNodeParser.ts +++ b/src/NodeParser/RestTypeNodeParser.ts @@ -1,11 +1,11 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; -import { InferType } from "../Type/InferType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { ArrayType } from "../Type/ArrayType.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { InferType } from "../Type/InferType.js"; import { RestType } from "../Type/RestType.js"; -import { TupleType } from "../Type/TupleType.js"; +import type { TupleType } from "../Type/TupleType.js"; export class RestTypeNodeParser implements SubNodeParser { public constructor(protected childNodeParser: NodeParser) {} diff --git a/src/NodeParser/SatisfiesNodeParser.ts b/src/NodeParser/SatisfiesNodeParser.ts index 1553b0ec0..7ffc646a7 100644 --- a/src/NodeParser/SatisfiesNodeParser.ts +++ b/src/NodeParser/SatisfiesNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; export class SatisfiesNodeParser implements SubNodeParser { public constructor(protected childNodeParser: NodeParser) {} diff --git a/src/NodeParser/StringLiteralNodeParser.ts b/src/NodeParser/StringLiteralNodeParser.ts index 45063fe0f..76ea964cf 100644 --- a/src/NodeParser/StringLiteralNodeParser.ts +++ b/src/NodeParser/StringLiteralNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { LiteralType } from "../Type/LiteralType.js"; export class StringLiteralNodeParser implements SubNodeParser { diff --git a/src/NodeParser/StringTypeNodeParser.ts b/src/NodeParser/StringTypeNodeParser.ts index 104c9ed7d..8c9d0c1a9 100644 --- a/src/NodeParser/StringTypeNodeParser.ts +++ b/src/NodeParser/StringTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { StringType } from "../Type/StringType.js"; export class StringTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/SymbolTypeNodeParser.ts b/src/NodeParser/SymbolTypeNodeParser.ts index 2dd70eefe..b55035528 100644 --- a/src/NodeParser/SymbolTypeNodeParser.ts +++ b/src/NodeParser/SymbolTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { SymbolType } from "../Type/SymbolType.js"; export class SymbolTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/TupleNodeParser.ts b/src/NodeParser/TupleNodeParser.ts index 281e8aa6e..e5c68ac66 100644 --- a/src/NodeParser/TupleNodeParser.ts +++ b/src/NodeParser/TupleNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { TupleType } from "../Type/TupleType.js"; export class TupleNodeParser implements SubNodeParser { diff --git a/src/NodeParser/TypeAliasNodeParser.ts b/src/NodeParser/TypeAliasNodeParser.ts index 5787c04a3..7f1ad0621 100644 --- a/src/NodeParser/TypeAliasNodeParser.ts +++ b/src/NodeParser/TypeAliasNodeParser.ts @@ -1,10 +1,10 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { AliasType } from "../Type/AliasType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NeverType } from "../Type/NeverType.js"; -import { ReferenceType } from "../Type/ReferenceType.js"; +import type { ReferenceType } from "../Type/ReferenceType.js"; import { getKey } from "../Utils/nodeKey.js"; export class TypeAliasNodeParser implements SubNodeParser { diff --git a/src/NodeParser/TypeLiteralNodeParser.ts b/src/NodeParser/TypeLiteralNodeParser.ts index e5098b3a1..b8852d64f 100644 --- a/src/NodeParser/TypeLiteralNodeParser.ts +++ b/src/NodeParser/TypeLiteralNodeParser.ts @@ -1,10 +1,11 @@ -import ts, { MethodSignature, PropertySignature } from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { MethodSignature, PropertySignature } from "typescript"; +import ts from "typescript"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NeverType } from "../Type/NeverType.js"; import { ObjectProperty, ObjectType } from "../Type/ObjectType.js"; -import { ReferenceType } from "../Type/ReferenceType.js"; +import type { ReferenceType } from "../Type/ReferenceType.js"; import { isNodeHidden } from "../Utils/isHidden.js"; import { getKey } from "../Utils/nodeKey.js"; diff --git a/src/NodeParser/TypeOperatorNodeParser.ts b/src/NodeParser/TypeOperatorNodeParser.ts index 78a9c16c2..5e4353d36 100644 --- a/src/NodeParser/TypeOperatorNodeParser.ts +++ b/src/NodeParser/TypeOperatorNodeParser.ts @@ -1,8 +1,8 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NumberType } from "../Type/NumberType.js"; import { ObjectType } from "../Type/ObjectType.js"; import { StringType } from "../Type/StringType.js"; diff --git a/src/NodeParser/UndefinedLiteralNodeParser.ts b/src/NodeParser/UndefinedLiteralNodeParser.ts index a821c0966..a0051eee0 100644 --- a/src/NodeParser/UndefinedLiteralNodeParser.ts +++ b/src/NodeParser/UndefinedLiteralNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NullType } from "../Type/NullType.js"; export class UndefinedLiteralNodeParser implements SubNodeParser { diff --git a/src/NodeParser/UndefinedTypeNodeParser.ts b/src/NodeParser/UndefinedTypeNodeParser.ts index de05142ec..6e54efea1 100644 --- a/src/NodeParser/UndefinedTypeNodeParser.ts +++ b/src/NodeParser/UndefinedTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { UndefinedType } from "../Type/UndefinedType.js"; export class UndefinedTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/UnionNodeParser.ts b/src/NodeParser/UnionNodeParser.ts index 656418c0a..3bf91b343 100644 --- a/src/NodeParser/UnionNodeParser.ts +++ b/src/NodeParser/UnionNodeParser.ts @@ -1,8 +1,8 @@ import ts from "typescript"; -import { Context, NodeParser } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; +import type { Context, NodeParser } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; import { UnionType } from "../Type/UnionType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { notNever } from "../Utils/notNever.js"; import { NeverType } from "../Type/NeverType.js"; diff --git a/src/NodeParser/UnknownTypeNodeParser.ts b/src/NodeParser/UnknownTypeNodeParser.ts index fcb5b8cfd..ce0d7e0af 100644 --- a/src/NodeParser/UnknownTypeNodeParser.ts +++ b/src/NodeParser/UnknownTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { UnknownType } from "../Type/UnknownType.js"; export class UnknownTypeNodeParser implements SubNodeParser { diff --git a/src/NodeParser/VoidTypeNodeParser.ts b/src/NodeParser/VoidTypeNodeParser.ts index c2f89c15e..5cb880467 100644 --- a/src/NodeParser/VoidTypeNodeParser.ts +++ b/src/NodeParser/VoidTypeNodeParser.ts @@ -1,7 +1,7 @@ import ts from "typescript"; -import { Context } from "../NodeParser.js"; -import { SubNodeParser } from "../SubNodeParser.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Context } from "../NodeParser.js"; +import type { SubNodeParser } from "../SubNodeParser.js"; +import type { BaseType } from "../Type/BaseType.js"; import { VoidType } from "../Type/VoidType.js"; export class VoidTypeNodeParser implements SubNodeParser { diff --git a/src/Schema/Definition.ts b/src/Schema/Definition.ts index cd2230364..ca7a23b7c 100644 --- a/src/Schema/Definition.ts +++ b/src/Schema/Definition.ts @@ -1,3 +1,3 @@ -import { JSONSchema7 } from "json-schema"; +import type { JSONSchema7 } from "json-schema"; export type Definition = JSONSchema7; diff --git a/src/Schema/RawType.ts b/src/Schema/RawType.ts index 5aa38ddc6..2231f1e93 100644 --- a/src/Schema/RawType.ts +++ b/src/Schema/RawType.ts @@ -1,4 +1,4 @@ -import { JSONSchema7Type, JSONSchema7TypeName } from "json-schema"; +import type { JSONSchema7Type, JSONSchema7TypeName } from "json-schema"; export type RawType = JSONSchema7Type; export type RawTypeName = JSONSchema7TypeName; diff --git a/src/Schema/Schema.ts b/src/Schema/Schema.ts index 7cd1387db..9423aaf98 100644 --- a/src/Schema/Schema.ts +++ b/src/Schema/Schema.ts @@ -1,3 +1,3 @@ -import { JSONSchema7 } from "json-schema"; +import type { JSONSchema7 } from "json-schema"; export type Schema = JSONSchema7; diff --git a/src/SubNodeParser.ts b/src/SubNodeParser.ts index 2109d4a40..92b0b11b1 100644 --- a/src/SubNodeParser.ts +++ b/src/SubNodeParser.ts @@ -1,5 +1,5 @@ -import ts from "typescript"; -import { NodeParser } from "./NodeParser.js"; +import type ts from "typescript"; +import type { NodeParser } from "./NodeParser.js"; export interface SubNodeParser extends NodeParser { supportsNode(node: ts.Node): boolean; diff --git a/src/SubTypeFormatter.ts b/src/SubTypeFormatter.ts index 1e5dc717e..07c3fa172 100644 --- a/src/SubTypeFormatter.ts +++ b/src/SubTypeFormatter.ts @@ -1,5 +1,5 @@ -import { BaseType } from "./Type/BaseType.js"; -import { TypeFormatter } from "./TypeFormatter.js"; +import type { BaseType } from "./Type/BaseType.js"; +import type { TypeFormatter } from "./TypeFormatter.js"; export interface SubTypeFormatter extends TypeFormatter { supportsType(type: BaseType): boolean; diff --git a/src/TopRefNodeParser.ts b/src/TopRefNodeParser.ts index dec37f697..3da799349 100644 --- a/src/TopRefNodeParser.ts +++ b/src/TopRefNodeParser.ts @@ -1,6 +1,6 @@ -import ts from "typescript"; -import { Context, NodeParser } from "./NodeParser.js"; -import { BaseType } from "./Type/BaseType.js"; +import type ts from "typescript"; +import type { Context, NodeParser } from "./NodeParser.js"; +import type { BaseType } from "./Type/BaseType.js"; import { DefinitionType } from "./Type/DefinitionType.js"; export class TopRefNodeParser implements NodeParser { diff --git a/src/Type/ConstructorType.ts b/src/Type/ConstructorType.ts index ec220872b..0ebe9999b 100644 --- a/src/Type/ConstructorType.ts +++ b/src/Type/ConstructorType.ts @@ -1,6 +1,6 @@ -import ts from "typescript"; +import type ts from "typescript"; import { BaseType } from "./BaseType.js"; -import { ObjectType } from "./ObjectType.js"; +import type { ObjectType } from "./ObjectType.js"; export class ConstructorType extends BaseType { private comment: string; diff --git a/src/Type/FunctionType.ts b/src/Type/FunctionType.ts index 169dac7ad..485373f92 100644 --- a/src/Type/FunctionType.ts +++ b/src/Type/FunctionType.ts @@ -1,6 +1,6 @@ -import ts from "typescript"; +import type ts from "typescript"; import { BaseType } from "./BaseType.js"; -import { ObjectType } from "./ObjectType.js"; +import type { ObjectType } from "./ObjectType.js"; export class FunctionType extends BaseType { private comment: string; diff --git a/src/Type/RestType.ts b/src/Type/RestType.ts index ac1e3b4c2..8f22d3662 100644 --- a/src/Type/RestType.ts +++ b/src/Type/RestType.ts @@ -1,7 +1,7 @@ -import { ArrayType } from "./ArrayType.js"; +import type { ArrayType } from "./ArrayType.js"; import { BaseType } from "./BaseType.js"; -import { InferType } from "./InferType.js"; -import { TupleType } from "./TupleType.js"; +import type { InferType } from "./InferType.js"; +import type { TupleType } from "./TupleType.js"; export class RestType extends BaseType { public constructor( diff --git a/src/Type/TupleType.ts b/src/Type/TupleType.ts index bacdd06b5..7f7e65a69 100644 --- a/src/Type/TupleType.ts +++ b/src/Type/TupleType.ts @@ -1,7 +1,7 @@ import { derefType } from "../Utils/derefType.js"; -import { ArrayType } from "./ArrayType.js"; +import type { ArrayType } from "./ArrayType.js"; import { BaseType } from "./BaseType.js"; -import { InferType } from "./InferType.js"; +import type { InferType } from "./InferType.js"; import { RestType } from "./RestType.js"; function normalize(types: Readonly>): Array { diff --git a/src/TypeFormatter.ts b/src/TypeFormatter.ts index edbb9bb03..33985c233 100644 --- a/src/TypeFormatter.ts +++ b/src/TypeFormatter.ts @@ -1,5 +1,5 @@ -import { Definition } from "./Schema/Definition.js"; -import { BaseType } from "./Type/BaseType.js"; +import type { Definition } from "./Schema/Definition.js"; +import type { BaseType } from "./Type/BaseType.js"; export interface TypeFormatter { getDefinition(type: BaseType): Definition; diff --git a/src/TypeFormatter/AliasTypeFormatter.ts b/src/TypeFormatter/AliasTypeFormatter.ts index 18ea3b29d..1fb75918a 100644 --- a/src/TypeFormatter/AliasTypeFormatter.ts +++ b/src/TypeFormatter/AliasTypeFormatter.ts @@ -1,8 +1,8 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { AliasType } from "../Type/AliasType.js"; -import { BaseType } from "../Type/BaseType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; export class AliasTypeFormatter implements SubTypeFormatter { public constructor(protected childTypeFormatter: TypeFormatter) {} diff --git a/src/TypeFormatter/AnyTypeFormatter.ts b/src/TypeFormatter/AnyTypeFormatter.ts index aa0d05cf9..6b684472b 100644 --- a/src/TypeFormatter/AnyTypeFormatter.ts +++ b/src/TypeFormatter/AnyTypeFormatter.ts @@ -1,7 +1,7 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { AnyType } from "../Type/AnyType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; export class AnyTypeFormatter implements SubTypeFormatter { public supportsType(type: BaseType): boolean { diff --git a/src/TypeFormatter/ArrayTypeFormatter.ts b/src/TypeFormatter/ArrayTypeFormatter.ts index 699f4a560..fe2f6c232 100644 --- a/src/TypeFormatter/ArrayTypeFormatter.ts +++ b/src/TypeFormatter/ArrayTypeFormatter.ts @@ -1,8 +1,8 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; export class ArrayTypeFormatter implements SubTypeFormatter { public constructor(private childTypeFormatter: TypeFormatter) {} diff --git a/src/TypeFormatter/BooleanTypeFormatter.ts b/src/TypeFormatter/BooleanTypeFormatter.ts index 5a022188a..c4e756084 100644 --- a/src/TypeFormatter/BooleanTypeFormatter.ts +++ b/src/TypeFormatter/BooleanTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { BooleanType } from "../Type/BooleanType.js"; export class BooleanTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/ConstructorTypeFormatter.ts b/src/TypeFormatter/ConstructorTypeFormatter.ts index e6ed6b003..1ae9cc380 100644 --- a/src/TypeFormatter/ConstructorTypeFormatter.ts +++ b/src/TypeFormatter/ConstructorTypeFormatter.ts @@ -1,4 +1,4 @@ -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { ConstructorType } from "../Type/ConstructorType.js"; import { FunctionTypeFormatter } from "./FunctionTypeFormatter.js"; diff --git a/src/TypeFormatter/DefinitionTypeFormatter.ts b/src/TypeFormatter/DefinitionTypeFormatter.ts index f068e352d..3ae1688d4 100644 --- a/src/TypeFormatter/DefinitionTypeFormatter.ts +++ b/src/TypeFormatter/DefinitionTypeFormatter.ts @@ -1,8 +1,8 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { DefinitionType } from "../Type/DefinitionType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; import { uniqueArray } from "../Utils/uniqueArray.js"; export class DefinitionTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/EnumTypeFormatter.ts b/src/TypeFormatter/EnumTypeFormatter.ts index 39a2799c0..b720f491d 100644 --- a/src/TypeFormatter/EnumTypeFormatter.ts +++ b/src/TypeFormatter/EnumTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { EnumType } from "../Type/EnumType.js"; import { typeName } from "../Utils/typeName.js"; import { uniqueArray } from "../Utils/uniqueArray.js"; diff --git a/src/TypeFormatter/FunctionTypeFormatter.ts b/src/TypeFormatter/FunctionTypeFormatter.ts index 596661be2..38abf6557 100644 --- a/src/TypeFormatter/FunctionTypeFormatter.ts +++ b/src/TypeFormatter/FunctionTypeFormatter.ts @@ -1,9 +1,9 @@ -import { FunctionOptions } from "../Config.js"; -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { FunctionOptions } from "../Config.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { FunctionType } from "../Type/FunctionType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; export class FunctionTypeFormatter implements SubTypeFormatter { constructor( diff --git a/src/TypeFormatter/HiddenTypeFormatter.ts b/src/TypeFormatter/HiddenTypeFormatter.ts index 30cd6dc97..fc69be6f1 100644 --- a/src/TypeFormatter/HiddenTypeFormatter.ts +++ b/src/TypeFormatter/HiddenTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { HiddenType } from "../Type/HiddenType.js"; export class HiddenTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/IntersectionTypeFormatter.ts b/src/TypeFormatter/IntersectionTypeFormatter.ts index 4554896b5..6829ec380 100644 --- a/src/TypeFormatter/IntersectionTypeFormatter.ts +++ b/src/TypeFormatter/IntersectionTypeFormatter.ts @@ -1,10 +1,10 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { IntersectionType } from "../Type/IntersectionType.js"; import { TupleType } from "../Type/TupleType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; import { getAllOfDefinitionReducer } from "../Utils/allOfDefinition.js"; import { uniqueArray } from "../Utils/uniqueArray.js"; diff --git a/src/TypeFormatter/LiteralTypeFormatter.ts b/src/TypeFormatter/LiteralTypeFormatter.ts index 32e3a1bb9..d36ebeced 100644 --- a/src/TypeFormatter/LiteralTypeFormatter.ts +++ b/src/TypeFormatter/LiteralTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { LiteralType } from "../Type/LiteralType.js"; import { typeName } from "../Utils/typeName.js"; diff --git a/src/TypeFormatter/LiteralUnionTypeFormatter.ts b/src/TypeFormatter/LiteralUnionTypeFormatter.ts index 937d2a0ed..f96e98b51 100644 --- a/src/TypeFormatter/LiteralUnionTypeFormatter.ts +++ b/src/TypeFormatter/LiteralUnionTypeFormatter.ts @@ -1,8 +1,9 @@ -import { Definition } from "../Schema/Definition.js"; -import { RawTypeName } from "../Schema/RawType.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; -import { LiteralType, LiteralValue } from "../Type/LiteralType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { RawTypeName } from "../Schema/RawType.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { LiteralValue } from "../Type/LiteralType.js"; +import { LiteralType } from "../Type/LiteralType.js"; import { NullType } from "../Type/NullType.js"; import { StringType } from "../Type/StringType.js"; import { UnionType } from "../Type/UnionType.js"; diff --git a/src/TypeFormatter/NeverTypeFormatter.ts b/src/TypeFormatter/NeverTypeFormatter.ts index f9f43f0cb..072635dbf 100644 --- a/src/TypeFormatter/NeverTypeFormatter.ts +++ b/src/TypeFormatter/NeverTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NeverType } from "../Type/NeverType.js"; export class NeverTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/NullTypeFormatter.ts b/src/TypeFormatter/NullTypeFormatter.ts index 547ce8df9..723290456 100644 --- a/src/TypeFormatter/NullTypeFormatter.ts +++ b/src/TypeFormatter/NullTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NullType } from "../Type/NullType.js"; export class NullTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/NumberTypeFormatter.ts b/src/TypeFormatter/NumberTypeFormatter.ts index f8f3c35be..141e74012 100644 --- a/src/TypeFormatter/NumberTypeFormatter.ts +++ b/src/TypeFormatter/NumberTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NumberType } from "../Type/NumberType.js"; export class NumberTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/ObjectTypeFormatter.ts b/src/TypeFormatter/ObjectTypeFormatter.ts index afda61dd7..d78dcf89b 100644 --- a/src/TypeFormatter/ObjectTypeFormatter.ts +++ b/src/TypeFormatter/ObjectTypeFormatter.ts @@ -1,17 +1,17 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { AnyType } from "../Type/AnyType.js"; import { SymbolType } from "../Type/SymbolType.js"; import { BaseType } from "../Type/BaseType.js"; import { ObjectProperty, ObjectType } from "../Type/ObjectType.js"; import { UndefinedType } from "../Type/UndefinedType.js"; import { UnionType } from "../Type/UnionType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; import { getAllOfDefinitionReducer } from "../Utils/allOfDefinition.js"; import { derefType } from "../Utils/derefType.js"; import { preserveAnnotation } from "../Utils/preserveAnnotation.js"; import { removeUndefined } from "../Utils/removeUndefined.js"; -import { StringMap } from "../Utils/StringMap.js"; +import type { StringMap } from "../Utils/StringMap.js"; import { uniqueArray } from "../Utils/uniqueArray.js"; import { NeverType } from "../Type/NeverType.js"; diff --git a/src/TypeFormatter/OptionalTypeFormatter.ts b/src/TypeFormatter/OptionalTypeFormatter.ts index 14644384e..e36f690e9 100644 --- a/src/TypeFormatter/OptionalTypeFormatter.ts +++ b/src/TypeFormatter/OptionalTypeFormatter.ts @@ -1,8 +1,8 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { OptionalType } from "../Type/OptionalType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; export class OptionalTypeFormatter implements SubTypeFormatter { public constructor(protected childTypeFormatter: TypeFormatter) {} diff --git a/src/TypeFormatter/ReferenceTypeFormatter.ts b/src/TypeFormatter/ReferenceTypeFormatter.ts index 23913b92b..66594b287 100644 --- a/src/TypeFormatter/ReferenceTypeFormatter.ts +++ b/src/TypeFormatter/ReferenceTypeFormatter.ts @@ -1,9 +1,9 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { DefinitionType } from "../Type/DefinitionType.js"; import { ReferenceType } from "../Type/ReferenceType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; export class ReferenceTypeFormatter implements SubTypeFormatter { public constructor( diff --git a/src/TypeFormatter/RestTypeFormatter.ts b/src/TypeFormatter/RestTypeFormatter.ts index a2f7ccd6f..d9be89b56 100644 --- a/src/TypeFormatter/RestTypeFormatter.ts +++ b/src/TypeFormatter/RestTypeFormatter.ts @@ -1,8 +1,8 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { RestType } from "../Type/RestType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; export class RestTypeFormatter implements SubTypeFormatter { public constructor(protected childTypeFormatter: TypeFormatter) {} diff --git a/src/TypeFormatter/StringTypeFormatter.ts b/src/TypeFormatter/StringTypeFormatter.ts index a8d3e7327..f85e11946 100644 --- a/src/TypeFormatter/StringTypeFormatter.ts +++ b/src/TypeFormatter/StringTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { StringType } from "../Type/StringType.js"; export class StringTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/SymbolTypeFormatter.ts b/src/TypeFormatter/SymbolTypeFormatter.ts index e011a427d..1775867ff 100644 --- a/src/TypeFormatter/SymbolTypeFormatter.ts +++ b/src/TypeFormatter/SymbolTypeFormatter.ts @@ -1,7 +1,7 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { SymbolType } from "../Type/SymbolType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; export class SymbolTypeFormatter implements SubTypeFormatter { public supportsType(type: BaseType): boolean { diff --git a/src/TypeFormatter/TupleTypeFormatter.ts b/src/TypeFormatter/TupleTypeFormatter.ts index ee471b6b0..8aa350e7c 100644 --- a/src/TypeFormatter/TupleTypeFormatter.ts +++ b/src/TypeFormatter/TupleTypeFormatter.ts @@ -1,11 +1,11 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { OptionalType } from "../Type/OptionalType.js"; import { RestType } from "../Type/RestType.js"; import { TupleType } from "../Type/TupleType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; import { notNever } from "../Utils/notNever.js"; import { uniqueArray } from "../Utils/uniqueArray.js"; diff --git a/src/TypeFormatter/UndefinedTypeFormatter.ts b/src/TypeFormatter/UndefinedTypeFormatter.ts index df2e2a128..82442a3e6 100644 --- a/src/TypeFormatter/UndefinedTypeFormatter.ts +++ b/src/TypeFormatter/UndefinedTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { UndefinedType } from "../Type/UndefinedType.js"; export class UndefinedTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/UnionTypeFormatter.ts b/src/TypeFormatter/UnionTypeFormatter.ts index adb5dcc0f..fd3b4c9dd 100644 --- a/src/TypeFormatter/UnionTypeFormatter.ts +++ b/src/TypeFormatter/UnionTypeFormatter.ts @@ -1,11 +1,11 @@ -import { JSONSchema7 } from "json-schema"; -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { JSONSchema7 } from "json-schema"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { LiteralType } from "../Type/LiteralType.js"; import { NeverType } from "../Type/NeverType.js"; import { UnionType } from "../Type/UnionType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; import { derefType } from "../Utils/derefType.js"; import { getTypeByKey } from "../Utils/typeKeys.js"; import { uniqueArray } from "../Utils/uniqueArray.js"; diff --git a/src/TypeFormatter/UnknownTypeFormatter.ts b/src/TypeFormatter/UnknownTypeFormatter.ts index bf5aa3b3f..da818ca9d 100644 --- a/src/TypeFormatter/UnknownTypeFormatter.ts +++ b/src/TypeFormatter/UnknownTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { UnknownType } from "../Type/UnknownType.js"; export class UnknownTypeFormatter implements SubTypeFormatter { diff --git a/src/TypeFormatter/VoidTypeFormatter.ts b/src/TypeFormatter/VoidTypeFormatter.ts index 83ce50df5..b0b5aed1a 100644 --- a/src/TypeFormatter/VoidTypeFormatter.ts +++ b/src/TypeFormatter/VoidTypeFormatter.ts @@ -1,6 +1,6 @@ -import { Definition } from "../Schema/Definition.js"; -import { SubTypeFormatter } from "../SubTypeFormatter.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { SubTypeFormatter } from "../SubTypeFormatter.js"; +import type { BaseType } from "../Type/BaseType.js"; import { VoidType } from "../Type/VoidType.js"; export class VoidTypeFormatter implements SubTypeFormatter { diff --git a/src/Utils/allOfDefinition.ts b/src/Utils/allOfDefinition.ts index 7da418110..beb0eb4f8 100644 --- a/src/Utils/allOfDefinition.ts +++ b/src/Utils/allOfDefinition.ts @@ -1,7 +1,7 @@ -import { Definition } from "../Schema/Definition.js"; -import { RawTypeName } from "../Schema/RawType.js"; -import { BaseType } from "../Type/BaseType.js"; -import { TypeFormatter } from "../TypeFormatter.js"; +import type { Definition } from "../Schema/Definition.js"; +import type { RawTypeName } from "../Schema/RawType.js"; +import type { BaseType } from "../Type/BaseType.js"; +import type { TypeFormatter } from "../TypeFormatter.js"; import { uniqueArray } from "./uniqueArray.js"; import { deepMerge } from "./deepMerge.js"; import { derefType } from "./derefType.js"; diff --git a/src/Utils/deepMerge.ts b/src/Utils/deepMerge.ts index 30bfa68af..fc6f3931a 100644 --- a/src/Utils/deepMerge.ts +++ b/src/Utils/deepMerge.ts @@ -1,6 +1,6 @@ -import { JSONSchema7Definition } from "json-schema"; -import { Definition } from "../Schema/Definition.js"; -import { RawType } from "../Schema/RawType.js"; +import type { JSONSchema7Definition } from "json-schema"; +import type { Definition } from "../Schema/Definition.js"; +import type { RawType } from "../Schema/RawType.js"; import { intersectionOfArrays } from "./intersectionOfArrays.js"; /** diff --git a/src/Utils/derefType.ts b/src/Utils/derefType.ts index 0c68d93e7..606146cca 100644 --- a/src/Utils/derefType.ts +++ b/src/Utils/derefType.ts @@ -1,6 +1,6 @@ import { AliasType } from "../Type/AliasType.js"; import { AnnotatedType } from "../Type/AnnotatedType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { DefinitionType } from "../Type/DefinitionType.js"; import { HiddenType } from "../Type/HiddenType.js"; import { NeverType } from "../Type/NeverType.js"; diff --git a/src/Utils/hasJsDocTag.ts b/src/Utils/hasJsDocTag.ts index df879ebac..19a5a0e5c 100644 --- a/src/Utils/hasJsDocTag.ts +++ b/src/Utils/hasJsDocTag.ts @@ -1,4 +1,4 @@ -import ts from "typescript"; +import type ts from "typescript"; import { symbolAtNode } from "./symbolAtNode.js"; export function hasJsDocTag(node: ts.Node, tagName: string): boolean { diff --git a/src/Utils/isAssignableTo.ts b/src/Utils/isAssignableTo.ts index 0ec183989..56ea2daaa 100644 --- a/src/Utils/isAssignableTo.ts +++ b/src/Utils/isAssignableTo.ts @@ -1,10 +1,11 @@ import { AnyType } from "../Type/AnyType.js"; import { ArrayType } from "../Type/ArrayType.js"; -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { EnumType } from "../Type/EnumType.js"; import { IntersectionType } from "../Type/IntersectionType.js"; import { NullType } from "../Type/NullType.js"; -import { ObjectProperty, ObjectType } from "../Type/ObjectType.js"; +import type { ObjectProperty } from "../Type/ObjectType.js"; +import { ObjectType } from "../Type/ObjectType.js"; import { OptionalType } from "../Type/OptionalType.js"; import { TupleType } from "../Type/TupleType.js"; import { UndefinedType } from "../Type/UndefinedType.js"; @@ -12,7 +13,8 @@ import { UnionType } from "../Type/UnionType.js"; import { UnknownType } from "../Type/UnknownType.js"; import { VoidType } from "../Type/VoidType.js"; import { derefType } from "./derefType.js"; -import { LiteralType, LiteralValue } from "../Type/LiteralType.js"; +import type { LiteralValue } from "../Type/LiteralType.js"; +import { LiteralType } from "../Type/LiteralType.js"; import { StringType } from "../Type/StringType.js"; import { NumberType } from "../Type/NumberType.js"; import { BooleanType } from "../Type/BooleanType.js"; diff --git a/src/Utils/isHidden.ts b/src/Utils/isHidden.ts index adb3c880a..cc41dbf6d 100644 --- a/src/Utils/isHidden.ts +++ b/src/Utils/isHidden.ts @@ -1,4 +1,4 @@ -import ts from "typescript"; +import type ts from "typescript"; import { hasJsDocTag } from "./hasJsDocTag.js"; export function isNodeHidden(node: ts.Node): boolean { diff --git a/src/Utils/narrowType.ts b/src/Utils/narrowType.ts index 13b060a67..501111eaa 100644 --- a/src/Utils/narrowType.ts +++ b/src/Utils/narrowType.ts @@ -1,4 +1,4 @@ -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { EnumType } from "../Type/EnumType.js"; import { NeverType } from "../Type/NeverType.js"; import { UnionType } from "../Type/UnionType.js"; diff --git a/src/Utils/nodeKey.ts b/src/Utils/nodeKey.ts index 0c460d55b..487868a22 100644 --- a/src/Utils/nodeKey.ts +++ b/src/Utils/nodeKey.ts @@ -1,6 +1,6 @@ import stringify from "safe-stable-stringify"; -import { Node } from "typescript"; -import { Context } from "../NodeParser.js"; +import type { Node } from "typescript"; +import type { Context } from "../NodeParser.js"; export function hash(a: string | boolean | number | (string | boolean | number)[] | object): string | number { if (typeof a === "number") { diff --git a/src/Utils/notNever.ts b/src/Utils/notNever.ts index 8fabcda56..0b70ad764 100644 --- a/src/Utils/notNever.ts +++ b/src/Utils/notNever.ts @@ -1,4 +1,4 @@ -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { NeverType } from "../Type/NeverType.js"; export function notNever(x: BaseType): boolean { diff --git a/src/Utils/preserveAnnotation.ts b/src/Utils/preserveAnnotation.ts index 789f7437b..74f8747b0 100644 --- a/src/Utils/preserveAnnotation.ts +++ b/src/Utils/preserveAnnotation.ts @@ -1,4 +1,4 @@ -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { AnnotatedType } from "../Type/AnnotatedType.js"; /** diff --git a/src/Utils/removeUndefined.ts b/src/Utils/removeUndefined.ts index abcdfbd0a..5d2ae4ddb 100644 --- a/src/Utils/removeUndefined.ts +++ b/src/Utils/removeUndefined.ts @@ -1,4 +1,4 @@ -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; import { UndefinedType } from "../Type/UndefinedType.js"; import { UnionType } from "../Type/UnionType.js"; import { derefAnnotatedType } from "./derefType.js"; diff --git a/src/Utils/typeKeys.ts b/src/Utils/typeKeys.ts index d73b2a5bb..1581b2107 100644 --- a/src/Utils/typeKeys.ts +++ b/src/Utils/typeKeys.ts @@ -6,7 +6,7 @@ import { IntersectionType } from "../Type/IntersectionType.js"; import { LiteralType } from "../Type/LiteralType.js"; import { NumberType } from "../Type/NumberType.js"; import { ObjectType } from "../Type/ObjectType.js"; -import { StringType } from "../Type/StringType.js"; +import type { StringType } from "../Type/StringType.js"; import { TupleType } from "../Type/TupleType.js"; import { UndefinedType } from "../Type/UndefinedType.js"; import { UnionType } from "../Type/UnionType.js"; diff --git a/src/Utils/uniqueTypeArray.ts b/src/Utils/uniqueTypeArray.ts index ccef94560..d3ddc4aa4 100644 --- a/src/Utils/uniqueTypeArray.ts +++ b/src/Utils/uniqueTypeArray.ts @@ -1,4 +1,4 @@ -import { BaseType } from "../Type/BaseType.js"; +import type { BaseType } from "../Type/BaseType.js"; export function uniqueTypeArray(types: T[]): T[] { const uniqueTypes = new Map(); diff --git a/test/config.test.ts b/test/config.test.ts index a9fc245ab..5cd680e01 100644 --- a/test/config.test.ts +++ b/test/config.test.ts @@ -4,18 +4,22 @@ import { readFileSync, writeFileSync } from "fs"; import { resolve } from "path"; import stringify from "safe-stable-stringify"; import ts from "typescript"; -import { FormatterAugmentor, createFormatter } from "../factory/formatter"; -import { ParserAugmentor, createParser } from "../factory/parser"; +import type { FormatterAugmentor } from "../factory/formatter"; +import { createFormatter } from "../factory/formatter"; +import type { ParserAugmentor } from "../factory/parser"; +import { createParser } from "../factory/parser"; import { createProgram } from "../factory/program"; -import { BaseType, Context, DefinitionType, ReferenceType, SubNodeParser } from "../index"; -import { CompletedConfig, Config, DEFAULT_CONFIG } from "../src/Config.js"; -import { Definition } from "../src/Schema/Definition.js"; +import type { BaseType, Context, ReferenceType, SubNodeParser } from "../index"; +import { DefinitionType } from "../index"; +import type { CompletedConfig, Config } from "../src/Config.js"; +import { DEFAULT_CONFIG } from "../src/Config.js"; +import type { Definition } from "../src/Schema/Definition.js"; import { SchemaGenerator } from "../src/SchemaGenerator.js"; -import { SubTypeFormatter } from "../src/SubTypeFormatter.js"; +import type { SubTypeFormatter } from "../src/SubTypeFormatter.js"; import { EnumType } from "../src/Type/EnumType.js"; import { FunctionType } from "../src/Type/FunctionType.js"; import { StringType } from "../src/Type/StringType.js"; -import { TypeFormatter } from "../src/TypeFormatter.js"; +import type { TypeFormatter } from "../src/TypeFormatter.js"; import { uniqueArray } from "../src/Utils/uniqueArray.js"; const basePath = "test/config"; diff --git a/test/invalid-data.test.ts b/test/invalid-data.test.ts index 5c7437373..64f52062d 100644 --- a/test/invalid-data.test.ts +++ b/test/invalid-data.test.ts @@ -1,9 +1,10 @@ import { resolve } from "path"; -import ts from "typescript"; +import type ts from "typescript"; import { createFormatter } from "../factory/formatter"; import { createParser } from "../factory/parser"; import { createProgram } from "../factory/program"; -import { CompletedConfig, DEFAULT_CONFIG } from "../src/Config.js"; +import type { CompletedConfig } from "../src/Config.js"; +import { DEFAULT_CONFIG } from "../src/Config.js"; import { SchemaGenerator } from "../src/SchemaGenerator.js"; function assertSchema(name: string, type: string, message: string) { diff --git a/test/utils.ts b/test/utils.ts index 38c2b060a..510ce9dc9 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -1,13 +1,15 @@ -import Ajv, { Options as AjvOptions } from "ajv"; +import type { Options as AjvOptions } from "ajv"; +import Ajv from "ajv"; import addFormats from "ajv-formats"; import { readFileSync, writeFileSync } from "fs"; import { resolve } from "path"; import stringify from "safe-stable-stringify"; -import ts from "typescript"; +import type ts from "typescript"; import { createFormatter } from "../factory/formatter"; import { createParser } from "../factory/parser"; import { createProgram } from "../factory/program"; -import { CompletedConfig, Config, DEFAULT_CONFIG } from "../src/Config.js"; +import type { CompletedConfig, Config } from "../src/Config.js"; +import { DEFAULT_CONFIG } from "../src/Config.js"; import { SchemaGenerator } from "../src/SchemaGenerator.js"; const validator = new Ajv({ discriminator: true }); diff --git a/test/vega-lite.test.ts b/test/vega-lite.test.ts index e6ea64947..cf8d14b42 100644 --- a/test/vega-lite.test.ts +++ b/test/vega-lite.test.ts @@ -1,6 +1,7 @@ import { readFileSync, writeFileSync } from "fs"; import { resolve } from "path"; -import { CompletedConfig, DEFAULT_CONFIG } from "../src/Config.js"; +import type { CompletedConfig } from "../src/Config.js"; +import { DEFAULT_CONFIG } from "../src/Config.js"; import { createGenerator } from "./utils"; import stringify from "safe-stable-stringify";