chore: 更新eslint相关依赖并作兼容处理

This commit is contained in:
xiaoxian521
2025-04-09 05:49:15 +08:00
parent 92cfa9763b
commit 583feae7b7
23 changed files with 210 additions and 192 deletions

View File

@@ -3,7 +3,7 @@ import { ref, unref, onMounted } from "vue";
import { LogicFlow } from "@logicflow/core";
interface Props {
lf: LogicFlow;
lf?: LogicFlow;
catTurboData?: boolean;
}

View File

@@ -9,8 +9,8 @@ type nodeListType = {
};
interface Props {
lf: LogicFlow;
nodeList: Array<nodeListType>;
lf?: LogicFlow;
nodeList?: Array<nodeListType>;
}
const props = withDefaults(defineProps<Props>(), {

View File

@@ -60,12 +60,15 @@ export function copyObj() {
copyIsArray,
clone,
i = 1,
// eslint-disable-next-line prefer-rest-params
target = arguments[0] || {}, // 使用||运算符排除隐式强制类型转换为false的数据类型
deep = false,
// eslint-disable-next-line prefer-const
len = arguments.length;
if (typeof target === "boolean") {
deep = target;
// eslint-disable-next-line prefer-rest-params
target = arguments[1] || {};
i++;
}
@@ -79,6 +82,7 @@ export function copyObj() {
for (; i < len; i++) {
//所以如果源对象中数据类型为Undefined或Null那么就会跳过本次循环接着循环下一个源对象
// eslint-disable-next-line prefer-rest-params
if ((options = arguments[i]) != null) {
// 如果遇到源对象的数据类型为Boolean, Number for in循环会被跳过不执行for in循环// src用于判断target对象是否存在name属性
for (name in options) {

View File

@@ -32,8 +32,8 @@ const calculate = (
const offset = el.getBoundingClientRect();
// 获取点击位置距离 el 的垂直和水平距离
let localX = e.clientX - offset.left;
let localY = e.clientY - offset.top;
const localX = e.clientX - offset.left;
const localY = e.clientY - offset.top;
let radius = 0;
let scale = 0.3;

View File

@@ -6,7 +6,7 @@ import EnterOutlined from "@/assets/svg/enter_outlined.svg?component";
import ArrowUpLine from "~icons/ri/arrow-up-line";
import ArrowDownLine from "~icons/ri/arrow-down-line";
withDefaults(defineProps<{ total: number }>(), {
withDefaults(defineProps<{ total?: number }>(), {
total: 0
});

View File

@@ -7,7 +7,7 @@ import { useNav } from "@/layout/hooks/useNav";
import ArrowLeft from "~icons/ri/arrow-left-double-fill";
interface Props {
isActive: boolean;
isActive?: boolean;
}
withDefaults(defineProps<Props>(), {

View File

@@ -7,7 +7,7 @@ import { useNav } from "@/layout/hooks/useNav";
import MenuFold from "~icons/ri/menu-fold-fill";
interface Props {
isActive: boolean;
isActive?: boolean;
}
withDefaults(defineProps<Props>(), {

View File

@@ -4,7 +4,7 @@ import MenuFold from "~icons/ri/menu-fold-fill";
import MenuUnfold from "~icons/ri/menu-unfold-fill";
interface Props {
isActive: boolean;
isActive?: boolean;
}
withDefaults(defineProps<Props>(), {

View File

@@ -10,7 +10,7 @@ import zhLocale from "element-plus/es/locale/lang/zh-cn";
const siphonI18n = (function () {
// 仅初始化一次国际化配置
let cache = Object.fromEntries(
const cache = Object.fromEntries(
Object.entries(
import.meta.glob("../../locales/*.y(a)?ml", { eager: true })
).map(([key, value]: any) => {

View File

@@ -140,8 +140,10 @@ Print.prototype = {
"position:absolute;width:0;height:0;top:-10px;left:-10px;"
);
// eslint-disable-next-line prefer-const
w = f.contentWindow || f.contentDocument;
// eslint-disable-next-line prefer-const
doc = f.contentDocument || f.contentWindow.document;
doc.open();
doc.write(content);

View File

@@ -3,7 +3,7 @@ import { ref } from "vue";
// 声明 props 类型
export interface FormProps {
formInline: {
formInline?: {
user: string;
region: string;
};

View File

@@ -3,7 +3,7 @@ import { useVModel } from "@vueuse/core";
// 声明 props 类型
export interface FormProps {
data: string;
data?: string;
}
// 声明 props 默认值

View File

@@ -3,7 +3,7 @@ import { ref } from "vue";
// 声明 props 类型
export interface FormProps {
formInline: {
formInline?: {
user: string;
region: string;
};

View File

@@ -3,7 +3,7 @@ import { useVModel } from "@vueuse/core";
// 声明 props 类型
export interface FormProps {
data: string;
data?: string;
}
// 声明 props 默认值

View File

@@ -73,7 +73,7 @@ export function useColumns(selectRef: Ref, formRef: Ref, tableRef: Ref) {
const onSearch = () => {
tableData.value = cloneTableData;
if (!isAllEmpty(searchForm.sexValue)) {
let sex = sexOptions
const sex = sexOptions
.map(sex => sex.value === Number(searchForm.sexValue) && sex.label)
.filter(Boolean)[0];
tableData.value = tableData.value.filter(data => data.sex === sex);