提交 02b0c20e 编写于 作者: fxy060608's avatar fxy060608

chore: lint

上级 067e1a7e
......@@ -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",
......
......@@ -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'
......
......@@ -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'
......
import {
normalizeArg,
initUTSProxyFunction,
initUTSProxyClass,
initUTSProxyFunction,
normalizeArg,
} from '../src/service/api/plugin/uts'
describe('uts-module', () => {
......
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', () => {
......
import { compileSFCScript as compile, assertCode } from '../utils'
import { assertCode, compileSFCScript as compile } from '../utils'
test('defineExpose()', () => {
const { content } = compile(`
......
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', () => {
......
import { compileSFCScript as compile, assertCode } from '../utils'
import { assertCode, compileSFCScript as compile } from '../utils'
describe('defineOptions()', () => {
test('basic usage', () => {
......
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', () => {
......
import { compileSFCScript as compile, assertCode } from './utils'
import { assertCode, compileSFCScript as compile } from './utils'
describe('SFC compile template', () => {
test('template with html', () => {
......
......@@ -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'
......
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(
......
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'
......
......@@ -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,
......
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'
......
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'
......
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'
......
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'
......
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 = {}) {
......
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'
......
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'
......
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'
......
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'
......
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'
......
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,
......
import postcss, { ProcessOptions } from 'postcss'
import postcss, { type ProcessOptions } from 'postcss'
import scopedPlugin from '../src/postcss/plugins/stylePluginScoped'
......
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'
......
import { BuiltInLocale } from '../src/index'
import type { BuiltInLocale } from '../src/index'
import { I18n } from '../src/index'
const messages = {
......
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', () => {
......
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'
......
......@@ -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'
......
......@@ -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(
......
import {
addMiniProgramPageJson,
COMPONENT_BIND_LINK,
addMiniProgramPageJson,
createTransformComponentLink,
} from '@dcloudio/uni-cli-shared'
import { MPErrorCodes } from '../src/errors'
......
......@@ -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(
......
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: {
......
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'
......
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 = {}) {
......
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(
......
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(
......
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, {
......
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 = {}) {
......
import { ComponentOptions, defineComponent } from 'vue'
import { type ComponentOptions, defineComponent } from 'vue'
import { initHooks, initUnknownHooks } from '../src/runtime/componentHooks'
const vueBasicOptions = defineComponent({
......
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'
......
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'
......
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'
......
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,
......
......@@ -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'
......
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'
......
// 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 = {
......
import { proxyStyle, UniCSSStyleDeclaration } from '../../src/vdom/Style'
import { UniCSSStyleDeclaration, proxyStyle } from '../../src/vdom/Style'
describe('vdom', () => {
test('style', () => {
......
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')
......
import { resolve } from 'path'
import {
resolveUTSPluginSourceMapFile,
generatedPositionFor,
originalPositionFor,
resolveUTSPluginSourceMapFile,
} from '../src'
const inputDir = resolve(__dirname, '../../playground/uts')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册