feat:add eslint and fix

This commit is contained in:
黄云飞
2022-03-22 14:48:10 +08:00
parent 764fd8bbad
commit c49b7b5978
59 changed files with 1117 additions and 317 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
import { IElement } from ".."
import { HORIZON_TAB, WRAP, ZERO } from "../dataset/constant/Common"
import { TEXTLIKE_ELEMENT_TYPE } from "../dataset/constant/Element"
import { ElementType } from "../dataset/enum/Element"
import { IElement } from '..'
import { HORIZON_TAB, WRAP, ZERO } from '../dataset/constant/Common'
import { TEXTLIKE_ELEMENT_TYPE } from '../dataset/constant/Element'
import { ElementType } from '../dataset/enum/Element'
export function writeText(text: string) {
if (!text) return
@@ -9,7 +9,7 @@ export function writeText(text: string) {
}
export function writeTextByElementList(elementList: IElement[]) {
let text: string = ``
let text = ``
function pickTextFromElement(payload: IElement[]) {
for (let e = 0; e < payload.length; e++) {
const element = payload[e]
+4 -4
View File
@@ -1,7 +1,7 @@
import { deepClone, getUUID } from "."
import { ElementType, IElement } from ".."
import { ZERO } from "../dataset/constant/Common"
import { EDITOR_ELEMENT_ZIP_ATTR } from "../dataset/constant/Element"
import { deepClone, getUUID } from '.'
import { ElementType, IElement } from '..'
import { ZERO } from '../dataset/constant/Common'
import { EDITOR_ELEMENT_ZIP_ATTR } from '../dataset/constant/Element'
export function formatElementList(elementList: IElement[], isHandleFirstElement = true) {
if (isHandleFirstElement && elementList[0]?.value !== ZERO) {
+1 -1
View File
@@ -50,5 +50,5 @@ export function getUUID(): string {
function S4(): string {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
}
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4())
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
}