chore(lint): 升级检查依赖并统一格式化与提交规范
This commit is contained in:
@@ -103,7 +103,7 @@ export function diffGenConfig(before: GenConfigForm, after: GenConfigForm): AiFi
|
||||
}
|
||||
|
||||
const beforeFields = new Map(
|
||||
(before.fieldConfigs ?? []).map((field) => [field.columnName, field])
|
||||
(before.fieldConfigs ?? []).map((field) => [field.columnName, field]),
|
||||
);
|
||||
(after.fieldConfigs ?? []).forEach((field) => {
|
||||
const origin = beforeFields.get(field.columnName);
|
||||
@@ -148,8 +148,8 @@ export function useAiFillDiff() {
|
||||
fieldChangeCount: field.changes.length,
|
||||
first: index === 0,
|
||||
...item,
|
||||
}))
|
||||
)
|
||||
})),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,8 +46,8 @@ export function useCodePreview(genConfigFormData: Ref<GenConfigForm>) {
|
||||
new Set(
|
||||
previewList
|
||||
.map((item) => item.language || item.fileName.split(".").pop() || "")
|
||||
.filter(Boolean)
|
||||
)
|
||||
.filter(Boolean),
|
||||
),
|
||||
);
|
||||
previewTypeOptions.value = typeOptions;
|
||||
previewTypes.value = [...typeOptions];
|
||||
@@ -104,7 +104,7 @@ export function useCodePreview(genConfigFormData: Ref<GenConfigForm>) {
|
||||
currentFileKey.value = first.key || "";
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -39,7 +39,7 @@ export function useGenConfig() {
|
||||
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
||||
.join("");
|
||||
genConfigFormData.value.entityName = camel;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// 日期类型字段默认用范围查询,比较符合直觉
|
||||
@@ -59,7 +59,7 @@ export function useGenConfig() {
|
||||
}
|
||||
});
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
{ deep: true, immediate: true },
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,10 +19,10 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
const lastPreviewFiles = ref<GeneratorPreviewItem[]>([]);
|
||||
|
||||
const needFrontend = computed(() =>
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "frontend")
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "frontend"),
|
||||
);
|
||||
const needBackend = computed(() =>
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "backend")
|
||||
lastPreviewFiles.value.some((f) => resolveRootForItem(f) === "backend"),
|
||||
);
|
||||
// 只要有预览文件就可以点写入按钮,目录在弹窗里选
|
||||
const canWriteToLocal = computed(() => lastPreviewFiles.value.length > 0);
|
||||
@@ -116,7 +116,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
async function writeFileToDir(
|
||||
dirHandle: FileSystemDirectoryHandle,
|
||||
filePath: string,
|
||||
content: string
|
||||
content: string,
|
||||
) {
|
||||
const normalized = filePath.replace(/\\/g, "/");
|
||||
const parts = normalized.split("/").filter(Boolean);
|
||||
@@ -134,7 +134,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
*/
|
||||
async function pathExists(
|
||||
dirHandle: FileSystemDirectoryHandle,
|
||||
filePath: string
|
||||
filePath: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
const normalized = filePath.replace(/\\/g, "/");
|
||||
@@ -155,7 +155,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
async function isSameFile(
|
||||
dirHandle: FileSystemDirectoryHandle,
|
||||
filePath: string,
|
||||
content: string
|
||||
content: string,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
const normalized = filePath.replace(/\\/g, "/");
|
||||
@@ -199,7 +199,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
const failed: string[] = [];
|
||||
|
||||
const files = lastPreviewFiles.value.filter(
|
||||
(f) => writeScope.value === "all" || resolveRootForItem(f) === writeScope.value
|
||||
(f) => writeScope.value === "all" || resolveRootForItem(f) === writeScope.value,
|
||||
);
|
||||
writeProgress.total = files.length;
|
||||
writeProgress.done = 0;
|
||||
@@ -256,7 +256,7 @@ export function useLocalWrite(genConfigFormData: Ref<GenConfigForm>) {
|
||||
|
||||
if (failed.length) {
|
||||
ElMessage.warning(
|
||||
`部分文件写入失败 ${failed.length} 个,成功 前端 ${frontCount} 个,后端 ${backCount} 个`
|
||||
`部分文件写入失败 ${failed.length} 个,成功 前端 ${frontCount} 个,后端 ${backCount} 个`,
|
||||
);
|
||||
} else {
|
||||
ElMessage.success(`写入完成:前端 ${frontCount} 个文件,后端 ${backCount} 个文件`);
|
||||
|
||||
Reference in New Issue
Block a user