From 738d13308fca8a1e66373899a6ecf8b23b68774d Mon Sep 17 00:00:00 2001 From: c0dedance <2627702283@qq.com> Date: Thu, 13 Oct 2022 20:55:38 +0800 Subject: [PATCH] refactor: merge duplicate imports --- src/ast/nodes/ArrowFunctionExpression.ts | 6 ++---- src/ast/nodes/NewExpression.ts | 4 ++-- src/ast/nodes/TaggedTemplateExpression.ts | 3 +-- src/ast/nodes/TemplateLiteral.ts | 4 ++-- src/ast/nodes/shared/FunctionBase.ts | 8 ++++---- src/ast/nodes/shared/FunctionNode.ts | 3 +-- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/ast/nodes/ArrowFunctionExpression.ts b/src/ast/nodes/ArrowFunctionExpression.ts index 8068bf07fa5..9cb07c5f85d 100644 --- a/src/ast/nodes/ArrowFunctionExpression.ts +++ b/src/ast/nodes/ArrowFunctionExpression.ts @@ -1,5 +1,4 @@ -import type { InclusionContext } from '../ExecutionContext'; -import { type HasEffectsContext } from '../ExecutionContext'; +import type { HasEffectsContext, InclusionContext } from '../ExecutionContext'; import type { NodeInteraction } from '../NodeInteractions'; import { INTERACTION_CALLED } from '../NodeInteractions'; import ReturnValueScope from '../scopes/ReturnValueScope'; @@ -9,8 +8,7 @@ import type BlockStatement from './BlockStatement'; import Identifier from './Identifier'; import type * as NodeType from './NodeType'; import FunctionBase from './shared/FunctionBase'; -import type { IncludeChildren } from './shared/Node'; -import { type ExpressionNode } from './shared/Node'; +import type { ExpressionNode, IncludeChildren } from './shared/Node'; import { ObjectEntity } from './shared/ObjectEntity'; import { OBJECT_PROTOTYPE } from './shared/ObjectPrototype'; import type { PatternNode } from './shared/Pattern'; diff --git a/src/ast/nodes/NewExpression.ts b/src/ast/nodes/NewExpression.ts index ce19c8f9e2c..276e4ad019f 100644 --- a/src/ast/nodes/NewExpression.ts +++ b/src/ast/nodes/NewExpression.ts @@ -7,8 +7,8 @@ import type { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions import { INTERACTION_ACCESSED, INTERACTION_CALLED } from '../NodeInteractions'; import { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker'; import type * as NodeType from './NodeType'; -import type { IncludeChildren } from './shared/Node'; -import { type ExpressionNode, NodeBase } from './shared/Node'; +import type { ExpressionNode, IncludeChildren } from './shared/Node'; +import { NodeBase } from './shared/Node'; export default class NewExpression extends NodeBase { declare arguments: ExpressionNode[]; diff --git a/src/ast/nodes/TaggedTemplateExpression.ts b/src/ast/nodes/TaggedTemplateExpression.ts index 0a146f58017..15287b8f71d 100644 --- a/src/ast/nodes/TaggedTemplateExpression.ts +++ b/src/ast/nodes/TaggedTemplateExpression.ts @@ -13,8 +13,7 @@ import type TemplateLiteral from './TemplateLiteral'; import CallExpressionBase from './shared/CallExpressionBase'; import type { ExpressionEntity } from './shared/Expression'; import { UNKNOWN_EXPRESSION } from './shared/Expression'; -import type { IncludeChildren } from './shared/Node'; -import { type ExpressionNode } from './shared/Node'; +import type { ExpressionNode, IncludeChildren } from './shared/Node'; export default class TaggedTemplateExpression extends CallExpressionBase { declare quasi: TemplateLiteral; diff --git a/src/ast/nodes/TemplateLiteral.ts b/src/ast/nodes/TemplateLiteral.ts index 21b51aa5e52..a07d212ef9f 100644 --- a/src/ast/nodes/TemplateLiteral.ts +++ b/src/ast/nodes/TemplateLiteral.ts @@ -11,8 +11,8 @@ import { } from '../values'; import type * as NodeType from './NodeType'; import type TemplateElement from './TemplateElement'; -import type { ExpressionEntity } from './shared/Expression'; -import { type LiteralValueOrUnknown, UNKNOWN_EXPRESSION, UnknownValue } from './shared/Expression'; +import type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression'; +import { UNKNOWN_EXPRESSION, UnknownValue } from './shared/Expression'; import { type ExpressionNode, NodeBase } from './shared/Node'; export default class TemplateLiteral extends NodeBase { diff --git a/src/ast/nodes/shared/FunctionBase.ts b/src/ast/nodes/shared/FunctionBase.ts index db0a92039b6..eb8095d98df 100644 --- a/src/ast/nodes/shared/FunctionBase.ts +++ b/src/ast/nodes/shared/FunctionBase.ts @@ -16,14 +16,14 @@ import { NODE_INTERACTION_UNKNOWN_CALL } from '../../NodeInteractions'; import type ReturnValueScope from '../../scopes/ReturnValueScope'; -import type { PathTracker } from '../../utils/PathTracker'; -import { type ObjectPath, UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; +import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; +import { UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker'; import BlockStatement from '../BlockStatement'; import * as NodeType from '../NodeType'; import RestElement from '../RestElement'; import type SpreadElement from '../SpreadElement'; -import type { LiteralValueOrUnknown } from './Expression'; -import { type ExpressionEntity, UNKNOWN_EXPRESSION } from './Expression'; +import type { ExpressionEntity, LiteralValueOrUnknown } from './Expression'; +import { UNKNOWN_EXPRESSION } from './Expression'; import { type ExpressionNode, type GenericEsTreeNode, diff --git a/src/ast/nodes/shared/FunctionNode.ts b/src/ast/nodes/shared/FunctionNode.ts index e2e7212829b..86815243cb5 100644 --- a/src/ast/nodes/shared/FunctionNode.ts +++ b/src/ast/nodes/shared/FunctionNode.ts @@ -2,8 +2,7 @@ import { type HasEffectsContext, type InclusionContext } from '../../ExecutionCo import type { NodeInteraction, NodeInteractionWithThisArgument } from '../../NodeInteractions'; import { INTERACTION_CALLED } from '../../NodeInteractions'; import FunctionScope from '../../scopes/FunctionScope'; -import type { PathTracker } from '../../utils/PathTracker'; -import { type ObjectPath } from '../../utils/PathTracker'; +import type { ObjectPath, PathTracker } from '../../utils/PathTracker'; import type BlockStatement from '../BlockStatement'; import Identifier, { type IdentifierWithVariable } from '../Identifier'; import { UNKNOWN_EXPRESSION } from './Expression';