From 02b0c20e46e6e7940fa5c8d660eeb90270c08232 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Thu, 11 Apr 2024 16:05:25 +0800 Subject: [PATCH] chore: lint --- package.json | 2 +- .../service/{amd.spec1.ts => amd.spec.bak} | 0 .../__tests__/service/dom/dom.spec.ts | 13 ++++--- .../__tests__/service/index.spec.ts | 10 +++--- packages/uni-app-plus/__tests__/uts.spec.ts | 4 +-- .../sfc/compileScript/defineEmits.spec.ts | 2 +- .../sfc/compileScript/defineExpose.spec.ts | 2 +- .../sfc/compileScript/defineModel.spec.ts | 2 +- .../sfc/compileScript/defineOptions.spec.ts | 2 +- .../sfc/compileScript/defineProps.spec.ts | 2 +- .../android/sfc/compileTemplate.spec.ts | 2 +- .../__tests__/android/sfc/utils.ts | 2 +- .../__tests__/android/testUtils.ts | 8 ++--- .../transforms/transformElement.spec.ts | 32 ++++++++--------- .../transforms/transformExpressions.spec.ts | 8 ++--- .../android/transforms/vBind.spec.ts | 18 +++++----- .../__tests__/android/transforms/vFor.spec.ts | 20 +++++------ .../android/transforms/vHtml.spec.ts | 2 +- .../__tests__/android/transforms/vIf.spec.ts | 34 +++++++++---------- .../android/transforms/vModel.spec.ts | 26 +++++++------- .../__tests__/android/transforms/vOn.spec.ts | 16 ++++----- .../transforms/vOnWithModifier.spec.ts | 10 +++--- .../android/transforms/vOnce.spec.ts | 2 +- .../android/transforms/vSlot.spec.ts | 34 +++++++++---------- .../__tests__/nvue/compiler.spec.ts | 4 +-- .../uni-cli-shared/__tests__/inject.spec.ts | 2 +- .../__tests__/stylePluginScoped.spec.ts | 2 +- .../__tests__/usingComponents.spec.ts | 2 +- packages/uni-i18n/__tests__/i18n.spec.ts | 2 +- packages/uni-i18n/__tests__/json.spec.ts | 2 +- packages/uni-i18n/__tests__/locale.spec.ts | 4 +-- packages/uni-mp-alipay/__tests__/testUtils.ts | 4 +-- packages/uni-mp-baidu/__tests__/testUtils.ts | 4 +-- .../__tests__/component.spec.ts | 2 +- packages/uni-mp-compiler/__tests__/test.ts | 2 +- .../uni-mp-compiler/__tests__/testUtils.ts | 4 +-- .../__tests__/transformElement.spec.ts | 12 ++++--- .../uni-mp-compiler/__tests__/vBind.spec.ts | 4 +-- .../uni-mp-compiler/__tests__/vFor.spec.ts | 10 +++--- .../uni-mp-compiler/__tests__/vIf.spec.ts | 4 +-- .../uni-mp-compiler/__tests__/vOn.mp.spec.ts | 4 +-- .../uni-mp-compiler/__tests__/vOn.spec.ts | 4 +-- packages/uni-mp-core/__tests__/hooks.spec.ts | 2 +- packages/uni-mp-jd/__tests__/testUtils.ts | 2 +- .../uni-mp-kuaishou/__tests__/testUtils.ts | 2 +- packages/uni-mp-qq/__tests__/testUtils.ts | 2 +- .../uni-mp-toutiao/__tests__/testUtils.ts | 4 +-- packages/uni-mp-weixin/__tests__/testUtils.ts | 4 +-- packages/uni-mp-xhs/__tests__/testUtils.ts | 2 +- .../__tests__/preprocess.spec.ts | 2 +- .../uni-shared/__tests__/vdom/style.spec.ts | 2 +- packages/uni-uts-v1/__tests__/code.spec.ts | 2 +- .../uni-uts-v1/__tests__/sourceMap.spec.ts | 2 +- 53 files changed, 177 insertions(+), 174 deletions(-) rename packages/uni-app-plus/__tests__/service/{amd.spec1.ts => amd.spec.bak} (100%) diff --git a/package.json b/package.json index b3ec86d3d5..d14a656eb3 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build:app": "node scripts/build.js uni-app-plus uni-app-vite uni-app-vue uni-app-uvue", "build:mp": "node scripts/build.js uni-mp-vue uni-mp-vite uni-mp-compiler uni-mp-alipay uni-mp-baidu uni-mp-kuaishou uni-mp-lark uni-mp-qq uni-mp-toutiao uni-mp-weixin uni-mp-xhs uni-quickapp-webview", "size": "npm run build size-check", - "lint": "eslint packages/*/src/**/*.ts", + "lint": "eslint packages/*/src/**/*.ts packages/*/__tests__/**/*.ts", "format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"", "test": "tsc -p ./test-dts/tsconfig.json && node scripts/test.js && jest", "test-dts": "tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.build.json", diff --git a/packages/uni-app-plus/__tests__/service/amd.spec1.ts b/packages/uni-app-plus/__tests__/service/amd.spec.bak similarity index 100% rename from packages/uni-app-plus/__tests__/service/amd.spec1.ts rename to packages/uni-app-plus/__tests__/service/amd.spec.bak diff --git a/packages/uni-app-plus/__tests__/service/dom/dom.spec.ts b/packages/uni-app-plus/__tests__/service/dom/dom.spec.ts index 0752a48293..cd95a009b3 100644 --- a/packages/uni-app-plus/__tests__/service/dom/dom.spec.ts +++ b/packages/uni-app-plus/__tests__/service/dom/dom.spec.ts @@ -7,14 +7,13 @@ import { ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_SET_TEXT, - CreateAction, - SetAttributeAction, - UniEventListener, + type CreateAction, EventModifierFlags, + type SetAttributeAction, + type UniEventListener, } from '@dcloudio/uni-shared' -import UniPageNode, { - createPageNode, -} from '../../../src/service/framework/dom/Page' +import type UniPageNode from '../../../src/service/framework/dom/Page' +import { createPageNode } from '../../../src/service/framework/dom/Page' import { createElement, createTextNode, @@ -22,7 +21,7 @@ import { } from '../../../../uni-app-vue/lib/service.runtime.esm' import { ACTION_TYPE_DICT, - DictAction, + type DictAction, setActionMinify, } from '../../../src/constants' import { decodeActions } from '../../../src/view/framework/dom/decodeActions' diff --git a/packages/uni-app-plus/__tests__/service/index.spec.ts b/packages/uni-app-plus/__tests__/service/index.spec.ts index acb388863c..4965be295c 100644 --- a/packages/uni-app-plus/__tests__/service/index.spec.ts +++ b/packages/uni-app-plus/__tests__/service/index.spec.ts @@ -2,14 +2,14 @@ import { compileTemplate } from '@vue/compiler-sfc' import { uniAppPlugin } from '../../../uni-app-vite/src/plugin' import { - ref, - nextTick, - createApp, - createVNode as _createVNode, - openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, + createVNode as _createVNode, + openBlock as _openBlock, withModifiers as _withModifiers, + createApp, + nextTick, + ref, } from '../../../uni-app-vue/lib/service.runtime.esm' import { createPageNode } from '../../src/service/framework/dom/Page' diff --git a/packages/uni-app-plus/__tests__/uts.spec.ts b/packages/uni-app-plus/__tests__/uts.spec.ts index b0578e1a2c..4320ddb6bf 100644 --- a/packages/uni-app-plus/__tests__/uts.spec.ts +++ b/packages/uni-app-plus/__tests__/uts.spec.ts @@ -1,7 +1,7 @@ import { - normalizeArg, - initUTSProxyFunction, initUTSProxyClass, + initUTSProxyFunction, + normalizeArg, } from '../src/service/api/plugin/uts' describe('uts-module', () => { diff --git a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineEmits.spec.ts b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineEmits.spec.ts index e64a73bdda..61add55ff9 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineEmits.spec.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineEmits.spec.ts @@ -1,5 +1,5 @@ import { BindingTypes } from '@vue/compiler-core' -import { compileSFCScript as compile, assertCode } from '../utils' +import { assertCode, compileSFCScript as compile } from '../utils' describe('defineEmits', () => { test('basic usage', () => { diff --git a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineExpose.spec.ts b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineExpose.spec.ts index 22b70256b1..466421a272 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineExpose.spec.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineExpose.spec.ts @@ -1,4 +1,4 @@ -import { compileSFCScript as compile, assertCode } from '../utils' +import { assertCode, compileSFCScript as compile } from '../utils' test('defineExpose()', () => { const { content } = compile(` diff --git a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineModel.spec.ts b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineModel.spec.ts index da42dc72f1..43a534752d 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineModel.spec.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineModel.spec.ts @@ -1,5 +1,5 @@ import { BindingTypes } from '@vue/compiler-core' -import { compileSFCScript as compile, assertCode } from '../utils' +import { assertCode, compileSFCScript as compile } from '../utils' describe('defineModel()', () => { test('basic usage', () => { diff --git a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineOptions.spec.ts b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineOptions.spec.ts index 73bef9005d..9be3c9a7ec 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineOptions.spec.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineOptions.spec.ts @@ -1,4 +1,4 @@ -import { compileSFCScript as compile, assertCode } from '../utils' +import { assertCode, compileSFCScript as compile } from '../utils' describe('defineOptions()', () => { test('basic usage', () => { diff --git a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineProps.spec.ts b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineProps.spec.ts index 46508a4903..c814896fb9 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineProps.spec.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/compileScript/defineProps.spec.ts @@ -1,5 +1,5 @@ import { BindingTypes } from '@vue/compiler-core' -import { compileSFCScript as compile, assertCode } from '../utils' +import { assertCode, compileSFCScript as compile } from '../utils' describe('defineProps', () => { test('basic usage', () => { diff --git a/packages/uni-app-uts/__tests__/android/sfc/compileTemplate.spec.ts b/packages/uni-app-uts/__tests__/android/sfc/compileTemplate.spec.ts index 8a8d808438..0eeb95af75 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/compileTemplate.spec.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/compileTemplate.spec.ts @@ -1,4 +1,4 @@ -import { compileSFCScript as compile, assertCode } from './utils' +import { assertCode, compileSFCScript as compile } from './utils' describe('SFC compile template', () => { test('template with html', () => { diff --git a/packages/uni-app-uts/__tests__/android/sfc/utils.ts b/packages/uni-app-uts/__tests__/android/sfc/utils.ts index 37ec7ce957..15af1909cf 100644 --- a/packages/uni-app-uts/__tests__/android/sfc/utils.ts +++ b/packages/uni-app-uts/__tests__/android/sfc/utils.ts @@ -2,8 +2,8 @@ import type { SFCParseOptions } from '@vue/compiler-sfc' import { parse as babelParse } from '@babel/parser' import { + type SFCScriptCompileOptions, compileScript, - SFCScriptCompileOptions, } from '../../../src/plugins/android/uvue/sfc/compiler/compileScript' import { genTemplateCode } from '../../../src/plugins/android/uvue/code/template' import { resolveGenTemplateCodeOptions } from '../../../src/plugins/android/uvue/sfc/template' diff --git a/packages/uni-app-uts/__tests__/android/testUtils.ts b/packages/uni-app-uts/__tests__/android/testUtils.ts index 194e9ad9aa..5d3634bf5d 100644 --- a/packages/uni-app-uts/__tests__/android/testUtils.ts +++ b/packages/uni-app-uts/__tests__/android/testUtils.ts @@ -1,13 +1,13 @@ import { isAppUVueNativeTag } from '@dcloudio/uni-shared' import { compile } from '../../src/plugins/android/uvue/compiler/index' -import { TemplateCompilerOptions } from '../../src/plugins/android/uvue/compiler/options' +import type { TemplateCompilerOptions } from '../../src/plugins/android/uvue/compiler/options' import { NodeTypes } from '@vue/compiler-core' import { - isString, - PatchFlags, - ShapeFlags, PatchFlagNames, + type PatchFlags, + type ShapeFlags, isArray, + isString, } from '@vue/shared' export function assert( diff --git a/packages/uni-app-uts/__tests__/android/transforms/transformElement.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/transformElement.spec.ts index aae4323f49..7e593bae86 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/transformElement.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/transformElement.spec.ts @@ -1,29 +1,29 @@ import { PatchFlags } from '@vue/shared' import { - RESOLVE_COMPONENT, + BASE_TRANSITION, + BindingTypes, CREATE_VNODE, + GUARD_REACTIVE_PROPS, + KEEP_ALIVE, MERGE_PROPS, + NORMALIZE_CLASS, + NORMALIZE_PROPS, + NORMALIZE_STYLE, + RESOLVE_COMPONENT, RESOLVE_DIRECTIVE, - TO_HANDLERS, - helperNameMap, - TELEPORT, RESOLVE_DYNAMIC_COMPONENT, SUSPENSE, - KEEP_ALIVE, - BASE_TRANSITION, - NORMALIZE_CLASS, - NORMALIZE_STYLE, - NORMALIZE_PROPS, - GUARD_REACTIVE_PROPS, + TELEPORT, + TO_HANDLERS, + helperNameMap, baseParse as parse, - BindingTypes, } from '@vue/compiler-core' import { + type DirectiveNode, NodeTypes, + type RootNode, + type VNodeCall, createObjectProperty, - DirectiveNode, - RootNode, - VNodeCall, } from '@vue/compiler-core' import { transformElement as baseTransformElement } from '@vue/compiler-core' import { compile as baseCompile } from '../../../src/plugins/android/uvue/compiler' @@ -33,9 +33,9 @@ import { transformBind } from '../../../src/plugins/android/uvue/compiler/transf import { createObjectMatcher, genFlagText } from '../testUtils' import { transformText } from '../../../src/plugins/android/uvue/compiler/transforms/transformText' -import { TemplateCompilerOptions } from '../../../src/plugins/android/uvue/compiler/options' +import type { TemplateCompilerOptions } from '../../../src/plugins/android/uvue/compiler/options' import { - NodeTransform, + type NodeTransform, transform, } from '../../../src/plugins/android/uvue/compiler/transform' import { transformExpression } from '../../../src/plugins/android/uvue/compiler/transforms/transformExpression' diff --git a/packages/uni-app-uts/__tests__/android/transforms/transformExpressions.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/transformExpressions.spec.ts index 120988554b..38a0673120 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/transformExpressions.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/transformExpressions.spec.ts @@ -2,9 +2,9 @@ import { BindingTypes, ConstantTypes, - DirectiveNode, - ElementNode, - InterpolationNode, + type DirectiveNode, + type ElementNode, + type InterpolationNode, NodeTypes, baseParse as parse, } from '@vue/compiler-core' @@ -13,7 +13,7 @@ import { transformIf } from '../../../src/plugins/android/uvue/compiler/transfor import { transformExpression } from '../../../src/plugins/android/uvue/compiler/transforms/transformExpression' import { compile as baseCompile } from '../../../src/plugins/android/uvue/compiler' -import { TemplateCompilerOptions } from '../../../src/plugins/android/uvue/compiler/options' +import type { TemplateCompilerOptions } from '../../../src/plugins/android/uvue/compiler/options' function parseWithExpressionTransform( template: string, diff --git a/packages/uni-app-uts/__tests__/android/transforms/vBind.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vBind.spec.ts index eb70c69119..3ce8b60ee6 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vBind.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vBind.spec.ts @@ -1,17 +1,17 @@ import { extend } from '@vue/shared' import { - baseParse as parse, - transform, - ElementNode, - ObjectExpression, - CompilerOptions, + CAMELIZE, + type CallExpression, + type CompilerOptions, + type ElementNode, ErrorCodes, - VNodeCall, - CallExpression, + NORMALIZE_PROPS, NodeTypes, - CAMELIZE, + type ObjectExpression, + type VNodeCall, helperNameMap, - NORMALIZE_PROPS, + baseParse as parse, + transform, transformElement, } from '@vue/compiler-core' import { transformBind } from '../../../src/plugins/android/uvue/compiler/transforms/vBind' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vFor.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vFor.spec.ts index 5db2d67445..9ec594aa96 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vFor.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vFor.spec.ts @@ -1,16 +1,16 @@ -import { extend, PatchFlags } from '@vue/shared' +import { PatchFlags, extend } from '@vue/shared' import { + type CompilerOptions, + ConstantTypes, + type ElementNode, + ErrorCodes, + type ForCodegenNode, + type ForNode, + type InterpolationNode, + NodeTypes, + type SimpleExpressionNode, baseParse as parse, transform, - ForNode, - ForCodegenNode, - CompilerOptions, - NodeTypes, - SimpleExpressionNode, - ErrorCodes, - ElementNode, - InterpolationNode, - ConstantTypes, transformElement, } from '@vue/compiler-core' import { transformIf } from '../../../src/plugins/android/uvue/compiler/transforms/vIf' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vHtml.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vHtml.spec.ts index 1d4ea53193..eec11be22a 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vHtml.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vHtml.spec.ts @@ -1,8 +1,8 @@ import { extend } from '@vue/shared' import { + type CompilerOptions, baseParse as parse, transform, - CompilerOptions, transformElement, } from '@vue/compiler-core' import { ErrorCodes } from '../../../src/plugins/android/uvue/compiler/errors' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vIf.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vIf.spec.ts index c06bf5f5a9..8c6d825183 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vIf.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vIf.spec.ts @@ -1,25 +1,25 @@ import { extend } from '@vue/shared' import { - baseParse as parse, - transform, - ElementNode, - CompilerOptions, - ErrorCodes, - VNodeCall, - NodeTypes, - NORMALIZE_PROPS, - IfNode, - IfConditionalExpression, - SimpleExpressionNode, - CommentNode, - ConditionalExpression, - ElementTypes, - IfBranchNode, - TextNode, CREATE_COMMENT, - MERGE_PROPS, + type CommentNode, + type CompilerOptions, + type ConditionalExpression, + type ElementNode, + ElementTypes, + ErrorCodes, FRAGMENT, + type IfBranchNode, + type IfConditionalExpression, + type IfNode, + MERGE_PROPS, + NORMALIZE_PROPS, + NodeTypes, + type SimpleExpressionNode, TO_HANDLERS, + type TextNode, + type VNodeCall, + baseParse as parse, + transform, transformElement, } from '@vue/compiler-core' import { transformIf } from '../../../src/plugins/android/uvue/compiler/transforms/vIf' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vModel.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vModel.spec.ts index e08309fde0..20adec4858 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vModel.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vModel.spec.ts @@ -1,26 +1,26 @@ import { extend } from '@vue/shared' import { - baseParse as parse, - transform, - ElementNode, - CompilerOptions, - ObjectExpression, - PlainElementNode, - ComponentNode, - NodeTypes, - VNodeCall, - NORMALIZE_PROPS, BindingTypes, - ForNode, + type CompilerOptions, + type ComponentNode, + type ElementNode, ErrorCodes, - transformElement, + type ForNode, + NORMALIZE_PROPS, + NodeTypes, + type ObjectExpression, + type PlainElementNode, + type VNodeCall, + baseParse as parse, trackSlotScopes, + transform, + transformElement, } from '@vue/compiler-core' import { transformFor } from '../../../src/plugins/android/uvue/compiler/transforms/vFor' import { transformExpression } from '../../../src/plugins/android/uvue/compiler/transforms/transformExpression' import { transformModel } from '../../../src/plugins/android/uvue/compiler/transforms/vModel' import { generate } from '../../../src/plugins/android/uvue/compiler/codegen' -import { CallExpression } from '@babel/types' +import type { CallExpression } from '@babel/types' import { assert } from '../testUtils' function parseWithVModel(template: string, options: CompilerOptions = {}) { diff --git a/packages/uni-app-uts/__tests__/android/transforms/vOn.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vOn.spec.ts index d263254c8a..5f139c9c6e 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vOn.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vOn.spec.ts @@ -1,16 +1,16 @@ import { extend } from '@vue/shared' import { - baseParse as parse, - CompilerOptions, - transform, - ElementNode, - transformElement, + type CompilerOptions, + type ElementNode, ErrorCodes, + NodeTypes, + type ObjectExpression, TO_HANDLER_KEY, + type VNodeCall, helperNameMap, - NodeTypes, - ObjectExpression, - VNodeCall, + baseParse as parse, + transform, + transformElement, } from '@vue/compiler-core' import { transformOn } from '../../../src/plugins/android/uvue/compiler/transforms/vOn' import { transformExpression } from '../../../src/plugins/android/uvue/compiler/transforms/transformExpression' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vOnWithModifier.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vOnWithModifier.spec.ts index 10f773b961..3a9a0b298f 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vOnWithModifier.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vOnWithModifier.spec.ts @@ -1,11 +1,11 @@ import { - baseParse as parse, - CompilerOptions, - ElementNode, + type CompilerOptions, + type ElementNode, NodeTypes, - ObjectExpression, + type ObjectExpression, + type VNodeCall, + baseParse as parse, transform, - VNodeCall, transformElement, } from '@vue/compiler-core' import { transformOn } from '../../../src/plugins/android/uvue/compiler/transforms/vOnWithModifier' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vOnce.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vOnce.spec.ts index 0de55ee386..234e4a14e7 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vOnce.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vOnce.spec.ts @@ -1,7 +1,7 @@ import { NodeTypes, SET_BLOCK_TRACKING, baseParse } from '@vue/compiler-core' import { getBaseTransformPreset } from '../../../src/plugins/android/uvue/compiler/index' import { transform } from '../../../src/plugins/android/uvue/compiler/transform' -import { TemplateCompilerOptions } from '../../../src/plugins/android/uvue/compiler/options' +import type { TemplateCompilerOptions } from '../../../src/plugins/android/uvue/compiler/options' import { generate } from '../../../src/plugins/android/uvue/compiler/codegen' import { RENDER_SLOT } from '../../../src/plugins/android/uvue/compiler/runtimeHelpers' diff --git a/packages/uni-app-uts/__tests__/android/transforms/vSlot.spec.ts b/packages/uni-app-uts/__tests__/android/transforms/vSlot.spec.ts index 2d161a88a2..7a89e61bbc 100644 --- a/packages/uni-app-uts/__tests__/android/transforms/vSlot.spec.ts +++ b/packages/uni-app-uts/__tests__/android/transforms/vSlot.spec.ts @@ -1,24 +1,24 @@ -import { extend, PatchFlags } from '@vue/shared' +import { PatchFlags, extend } from '@vue/shared' import { - CompilerOptions, - baseParse as parse, - transform, - generate, - ElementNode, - NodeTypes, + CREATE_SLOTS, + type CompilerOptions, + type ComponentNode, + type ElementNode, ErrorCodes, - ForNode, - ComponentNode, - VNodeCall, - SlotsExpression, - ObjectExpression, - SimpleExpressionNode, - RenderSlotCall, - transformElement, + type ForNode, + NodeTypes, + type ObjectExpression, + RENDER_LIST, + type RenderSlotCall, + type SimpleExpressionNode, + type SlotsExpression, + type VNodeCall, + generate, + baseParse as parse, trackSlotScopes, trackVForSlotScopes, - CREATE_SLOTS, - RENDER_LIST, + transform, + transformElement, } from '@vue/compiler-core' import { transformOn } from '../../../src/plugins/android/uvue/compiler/transforms/vOn' import { transformBind } from '../../../src/plugins/android/uvue/compiler/transforms/vBind' diff --git a/packages/uni-app-vite/__tests__/nvue/compiler.spec.ts b/packages/uni-app-vite/__tests__/nvue/compiler.spec.ts index 8d878e6010..f4dba0f3c1 100644 --- a/packages/uni-app-vite/__tests__/nvue/compiler.spec.ts +++ b/packages/uni-app-vite/__tests__/nvue/compiler.spec.ts @@ -1,9 +1,9 @@ import { NVUE_U_BUILT_IN_TAGS } from '@dcloudio/uni-shared' import { - ElementNode, + type ElementNode, ElementTypes, + type SimpleExpressionNode, findDir, - SimpleExpressionNode, } from '@vue/compiler-core' import { compileTemplate } from '@vue/compiler-sfc' import { uniOptions } from '../../src/plugin/uni/index' diff --git a/packages/uni-cli-shared/__tests__/inject.spec.ts b/packages/uni-cli-shared/__tests__/inject.spec.ts index 9220765c6d..cf744435c5 100644 --- a/packages/uni-cli-shared/__tests__/inject.spec.ts +++ b/packages/uni-cli-shared/__tests__/inject.spec.ts @@ -1,5 +1,5 @@ import { parse } from '@babel/parser' -import { SourceDescription, TransformPluginContext } from 'rollup' +import type { SourceDescription, TransformPluginContext } from 'rollup' import { uniViteInjectPlugin } from '../src/vite/plugins/inject' const injectOptions = { sourceMap: false, diff --git a/packages/uni-cli-shared/__tests__/stylePluginScoped.spec.ts b/packages/uni-cli-shared/__tests__/stylePluginScoped.spec.ts index 96b3f5ed8c..e99b9fa285 100644 --- a/packages/uni-cli-shared/__tests__/stylePluginScoped.spec.ts +++ b/packages/uni-cli-shared/__tests__/stylePluginScoped.spec.ts @@ -1,4 +1,4 @@ -import postcss, { ProcessOptions } from 'postcss' +import postcss, { type ProcessOptions } from 'postcss' import scopedPlugin from '../src/postcss/plugins/stylePluginScoped' diff --git a/packages/uni-cli-shared/__tests__/usingComponents.spec.ts b/packages/uni-cli-shared/__tests__/usingComponents.spec.ts index d2d6f5c331..ed7cf78c0b 100644 --- a/packages/uni-cli-shared/__tests__/usingComponents.spec.ts +++ b/packages/uni-cli-shared/__tests__/usingComponents.spec.ts @@ -1,5 +1,5 @@ import path from 'path' -import { ResolvedId } from 'rollup' +import type { ResolvedId } from 'rollup' import { normalizePath } from '../src/utils' import { findUsingComponents } from '../src/json/mp/jsonFile' import { parseProgram } from '../src/mp/ast' diff --git a/packages/uni-i18n/__tests__/i18n.spec.ts b/packages/uni-i18n/__tests__/i18n.spec.ts index a245071a5b..3272cf41d7 100644 --- a/packages/uni-i18n/__tests__/i18n.spec.ts +++ b/packages/uni-i18n/__tests__/i18n.spec.ts @@ -1,4 +1,4 @@ -import { BuiltInLocale } from '../src/index' +import type { BuiltInLocale } from '../src/index' import { I18n } from '../src/index' const messages = { diff --git a/packages/uni-i18n/__tests__/json.spec.ts b/packages/uni-i18n/__tests__/json.spec.ts index 3885125aeb..026bb89294 100644 --- a/packages/uni-i18n/__tests__/json.spec.ts +++ b/packages/uni-i18n/__tests__/json.spec.ts @@ -1,5 +1,5 @@ import { I18N_JSON_DELIMITERS } from '@dcloudio/uni-shared' -import { parseI18nJson, compileI18nJsonStr } from '../src/json' +import { compileI18nJsonStr, parseI18nJson } from '../src/json' const delimiters: [string, string] = I18N_JSON_DELIMITERS describe('parseI18nJson', () => { test('pages.json->style', () => { diff --git a/packages/uni-i18n/__tests__/locale.spec.ts b/packages/uni-i18n/__tests__/locale.spec.ts index 8761c1b37a..e1cc22a8aa 100644 --- a/packages/uni-i18n/__tests__/locale.spec.ts +++ b/packages/uni-i18n/__tests__/locale.spec.ts @@ -1,9 +1,9 @@ import { - LOCALE_ZH_HANS, - LOCALE_ZH_HANT, LOCALE_EN, LOCALE_ES, LOCALE_FR, + LOCALE_ZH_HANS, + LOCALE_ZH_HANT, } from '../src/I18n' import { resolveLocale } from '../src/locale' diff --git a/packages/uni-mp-alipay/__tests__/testUtils.ts b/packages/uni-mp-alipay/__tests__/testUtils.ts index d75e8787e1..e69662b180 100644 --- a/packages/uni-mp-alipay/__tests__/testUtils.ts +++ b/packages/uni-mp-alipay/__tests__/testUtils.ts @@ -2,11 +2,11 @@ import { createIsCustomElement, isMiniProgramNativeTag as isNativeTag, } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { - customElements, compilerOptions, + customElements, miniProgram, } from '../src/compiler/options' diff --git a/packages/uni-mp-baidu/__tests__/testUtils.ts b/packages/uni-mp-baidu/__tests__/testUtils.ts index b24b2b0fd3..79d951beda 100644 --- a/packages/uni-mp-baidu/__tests__/testUtils.ts +++ b/packages/uni-mp-baidu/__tests__/testUtils.ts @@ -2,11 +2,11 @@ import { createIsCustomElement, isMiniProgramNativeTag as isNativeTag, } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { + compilerOptions, customElements, miniProgram, - compilerOptions, } from '../src/compiler/options' export function assert( diff --git a/packages/uni-mp-compiler/__tests__/component.spec.ts b/packages/uni-mp-compiler/__tests__/component.spec.ts index 57e47549ea..59277af039 100644 --- a/packages/uni-mp-compiler/__tests__/component.spec.ts +++ b/packages/uni-mp-compiler/__tests__/component.spec.ts @@ -1,6 +1,6 @@ import { - addMiniProgramPageJson, COMPONENT_BIND_LINK, + addMiniProgramPageJson, createTransformComponentLink, } from '@dcloudio/uni-cli-shared' import { MPErrorCodes } from '../src/errors' diff --git a/packages/uni-mp-compiler/__tests__/test.ts b/packages/uni-mp-compiler/__tests__/test.ts index 661d58755b..4ecc65c7df 100644 --- a/packages/uni-mp-compiler/__tests__/test.ts +++ b/packages/uni-mp-compiler/__tests__/test.ts @@ -5,7 +5,7 @@ import { transformComponentLink, } from '@dcloudio/uni-cli-shared' import { compile } from '../src/index' -import { CompilerOptions } from '../src/options' +import type { CompilerOptions } from '../src/options' import { miniProgram } from './testUtils' function assert( diff --git a/packages/uni-mp-compiler/__tests__/testUtils.ts b/packages/uni-mp-compiler/__tests__/testUtils.ts index 43d7d96836..94e2ac485c 100644 --- a/packages/uni-mp-compiler/__tests__/testUtils.ts +++ b/packages/uni-mp-compiler/__tests__/testUtils.ts @@ -1,10 +1,10 @@ -import { MiniProgramCompilerOptions } from '@dcloudio/uni-cli-shared' +import type { MiniProgramCompilerOptions } from '@dcloudio/uni-cli-shared' import { createIsCustomElement, isMiniProgramNativeTag as isNativeTag, } from '@dcloudio/uni-shared' import { compile } from '../src/index' -import { CompilerOptions } from '../src/options' +import type { CompilerOptions } from '../src/options' export const miniProgram: MiniProgramCompilerOptions = { class: { diff --git a/packages/uni-mp-compiler/__tests__/transformElement.spec.ts b/packages/uni-mp-compiler/__tests__/transformElement.spec.ts index 4bdb624004..b7d271d511 100644 --- a/packages/uni-mp-compiler/__tests__/transformElement.spec.ts +++ b/packages/uni-mp-compiler/__tests__/transformElement.spec.ts @@ -1,13 +1,17 @@ -import { BindingTypes, ElementNode, RootNode } from '@vue/compiler-core' import { + BindingTypes, + type ElementNode, + type RootNode, +} from '@vue/compiler-core' +import { + type SFCTemplateCompileOptions, + type TemplateCompiler, compileTemplate, - SFCTemplateCompileOptions, - TemplateCompiler, } from '@vue/compiler-sfc' import { compile } from '../src' import * as MPCompiler from '../src' import { MPErrorCodes } from '../src/errors' -import { CodegenRootNode, CompilerOptions } from '../src/options' +import type { CodegenRootNode, CompilerOptions } from '../src/options' import { BindingComponentTypes } from '../src/transform' import { getBaseNodeTransforms } from '@dcloudio/uni-cli-shared' diff --git a/packages/uni-mp-compiler/__tests__/vBind.spec.ts b/packages/uni-mp-compiler/__tests__/vBind.spec.ts index e34aed7b9a..dbd840aac2 100644 --- a/packages/uni-mp-compiler/__tests__/vBind.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vBind.spec.ts @@ -1,7 +1,7 @@ -import { ElementNode, ErrorCodes } from '@vue/compiler-core' +import { type ElementNode, ErrorCodes } from '@vue/compiler-core' import { compile } from '../src' import { MPErrorCodes } from '../src/errors' -import { CompilerOptions } from '../src/options' +import type { CompilerOptions } from '../src/options' import { assert, miniProgram } from './testUtils' function parseWithVBind(template: string, options: CompilerOptions = {}) { diff --git a/packages/uni-mp-compiler/__tests__/vFor.spec.ts b/packages/uni-mp-compiler/__tests__/vFor.spec.ts index 7b7a8109da..5dd8ff367a 100644 --- a/packages/uni-mp-compiler/__tests__/vFor.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vFor.spec.ts @@ -1,13 +1,13 @@ import { - ElementNode, + type ElementNode, ErrorCodes, - InterpolationNode, + type InterpolationNode, NodeTypes, - SimpleExpressionNode, + type SimpleExpressionNode, } from '@vue/compiler-core' import { compile } from '../src' -import { CompilerOptions } from '../src/options' -import { ForElementNode } from '../src/transforms/vFor' +import type { CompilerOptions } from '../src/options' +import type { ForElementNode } from '../src/transforms/vFor' import { assert } from './testUtils' function parseWithForTransform( diff --git a/packages/uni-mp-compiler/__tests__/vIf.spec.ts b/packages/uni-mp-compiler/__tests__/vIf.spec.ts index 35a2bbf4df..a62680cc06 100644 --- a/packages/uni-mp-compiler/__tests__/vIf.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vIf.spec.ts @@ -1,6 +1,6 @@ -import { ErrorCodes, IfNode, NodeTypes } from '@vue/compiler-core' +import { ErrorCodes, type IfNode, NodeTypes } from '@vue/compiler-core' import { compile } from '../src' -import { CompilerOptions } from '../src/options' +import type { CompilerOptions } from '../src/options' import { assert } from './testUtils' function compileWithIfTransform( diff --git a/packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts b/packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts index 29d12ee370..b9ca97ab92 100644 --- a/packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vOn.mp.spec.ts @@ -1,7 +1,7 @@ -import { ElementNode } from '@vue/compiler-core' +import type { ElementNode } from '@vue/compiler-core' import { compile } from '../src' import { MPErrorCodes } from '../src/errors' -import { CompilerOptions } from '../src/options' +import type { CompilerOptions } from '../src/options' function parseWithVOn(template: string, options: CompilerOptions = {}) { const { ast } = compile(template, { diff --git a/packages/uni-mp-compiler/__tests__/vOn.spec.ts b/packages/uni-mp-compiler/__tests__/vOn.spec.ts index 1e2e5ed298..8fdf5f4cda 100644 --- a/packages/uni-mp-compiler/__tests__/vOn.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vOn.spec.ts @@ -1,6 +1,6 @@ -import { ElementNode, ErrorCodes } from '@vue/compiler-core' +import { type ElementNode, ErrorCodes } from '@vue/compiler-core' import { compile } from '../src' -import { CompilerOptions } from '../src/options' +import type { CompilerOptions } from '../src/options' import { assert } from './testUtils' function parseWithVOn(template: string, options: CompilerOptions = {}) { diff --git a/packages/uni-mp-core/__tests__/hooks.spec.ts b/packages/uni-mp-core/__tests__/hooks.spec.ts index d6d4a00186..05a5d75c6c 100644 --- a/packages/uni-mp-core/__tests__/hooks.spec.ts +++ b/packages/uni-mp-core/__tests__/hooks.spec.ts @@ -1,4 +1,4 @@ -import { ComponentOptions, defineComponent } from 'vue' +import { type ComponentOptions, defineComponent } from 'vue' import { initHooks, initUnknownHooks } from '../src/runtime/componentHooks' const vueBasicOptions = defineComponent({ diff --git a/packages/uni-mp-jd/__tests__/testUtils.ts b/packages/uni-mp-jd/__tests__/testUtils.ts index b44369157c..693710796c 100644 --- a/packages/uni-mp-jd/__tests__/testUtils.ts +++ b/packages/uni-mp-jd/__tests__/testUtils.ts @@ -1,5 +1,5 @@ import { isMiniProgramNativeTag as isNativeTag } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { compilerOptions, miniProgram } from '../src/compiler/options' diff --git a/packages/uni-mp-kuaishou/__tests__/testUtils.ts b/packages/uni-mp-kuaishou/__tests__/testUtils.ts index 7728a6d9e0..d3c4c2b857 100644 --- a/packages/uni-mp-kuaishou/__tests__/testUtils.ts +++ b/packages/uni-mp-kuaishou/__tests__/testUtils.ts @@ -1,5 +1,5 @@ import { isMiniProgramNativeTag as isNativeTag } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { compilerOptions, miniProgram } from '../src/compiler/options' diff --git a/packages/uni-mp-qq/__tests__/testUtils.ts b/packages/uni-mp-qq/__tests__/testUtils.ts index 7728a6d9e0..d3c4c2b857 100644 --- a/packages/uni-mp-qq/__tests__/testUtils.ts +++ b/packages/uni-mp-qq/__tests__/testUtils.ts @@ -1,5 +1,5 @@ import { isMiniProgramNativeTag as isNativeTag } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { compilerOptions, miniProgram } from '../src/compiler/options' diff --git a/packages/uni-mp-toutiao/__tests__/testUtils.ts b/packages/uni-mp-toutiao/__tests__/testUtils.ts index cba65f91de..cfcadcd466 100644 --- a/packages/uni-mp-toutiao/__tests__/testUtils.ts +++ b/packages/uni-mp-toutiao/__tests__/testUtils.ts @@ -1,7 +1,7 @@ import { isMiniProgramNativeTag as isNativeTag } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' -import { miniProgram, compilerOptions } from '../src/compiler/options' +import { compilerOptions, miniProgram } from '../src/compiler/options' export function assert( template: string, diff --git a/packages/uni-mp-weixin/__tests__/testUtils.ts b/packages/uni-mp-weixin/__tests__/testUtils.ts index b64808f22a..322b3da400 100644 --- a/packages/uni-mp-weixin/__tests__/testUtils.ts +++ b/packages/uni-mp-weixin/__tests__/testUtils.ts @@ -2,11 +2,11 @@ import { createIsCustomElement, isMiniProgramNativeTag as isNativeTag, } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { - customElements, compilerOptions, + customElements, miniProgram, } from '../src/compiler/options' diff --git a/packages/uni-mp-xhs/__tests__/testUtils.ts b/packages/uni-mp-xhs/__tests__/testUtils.ts index b44369157c..693710796c 100644 --- a/packages/uni-mp-xhs/__tests__/testUtils.ts +++ b/packages/uni-mp-xhs/__tests__/testUtils.ts @@ -1,5 +1,5 @@ import { isMiniProgramNativeTag as isNativeTag } from '@dcloudio/uni-shared' -import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { type CompilerOptions, compile } from '@dcloudio/uni-mp-compiler' import { compilerOptions, miniProgram } from '../src/compiler/options' diff --git a/packages/uni-preprocess/__tests__/preprocess.spec.ts b/packages/uni-preprocess/__tests__/preprocess.spec.ts index 6605d04840..86052daa29 100644 --- a/packages/uni-preprocess/__tests__/preprocess.spec.ts +++ b/packages/uni-preprocess/__tests__/preprocess.spec.ts @@ -1,6 +1,6 @@ // import { writeFileSync } from 'node:fs' // import { resolve } from 'node:path' -import { preprocess, SourceMapOptions } from '../src/index' +import { type SourceMapOptions, preprocess } from '../src/index' describe('preprocess', () => { const sourceMap: SourceMapOptions = { diff --git a/packages/uni-shared/__tests__/vdom/style.spec.ts b/packages/uni-shared/__tests__/vdom/style.spec.ts index d1b9c6e27f..7a8bf66112 100644 --- a/packages/uni-shared/__tests__/vdom/style.spec.ts +++ b/packages/uni-shared/__tests__/vdom/style.spec.ts @@ -1,4 +1,4 @@ -import { proxyStyle, UniCSSStyleDeclaration } from '../../src/vdom/Style' +import { UniCSSStyleDeclaration, proxyStyle } from '../../src/vdom/Style' describe('vdom', () => { test('style', () => { diff --git a/packages/uni-uts-v1/__tests__/code.spec.ts b/packages/uni-uts-v1/__tests__/code.spec.ts index bb7cf8b645..ed38215cec 100644 --- a/packages/uni-uts-v1/__tests__/code.spec.ts +++ b/packages/uni-uts-v1/__tests__/code.spec.ts @@ -1,5 +1,5 @@ import { resolve } from 'path' -import { FORMATS, GenProxyCodeOptions, genProxyCode } from '../src/code' +import { FORMATS, type GenProxyCodeOptions, genProxyCode } from '../src/code' import { ERR_MSG_PLACEHOLDER } from '../src/utils' const inputDir = resolve(__dirname, 'examples/uts') diff --git a/packages/uni-uts-v1/__tests__/sourceMap.spec.ts b/packages/uni-uts-v1/__tests__/sourceMap.spec.ts index 715f306917..f2a4008c9a 100644 --- a/packages/uni-uts-v1/__tests__/sourceMap.spec.ts +++ b/packages/uni-uts-v1/__tests__/sourceMap.spec.ts @@ -1,8 +1,8 @@ import { resolve } from 'path' import { - resolveUTSPluginSourceMapFile, generatedPositionFor, originalPositionFor, + resolveUTSPluginSourceMapFile, } from '../src' const inputDir = resolve(__dirname, '../../playground/uts') -- GitLab