fix(lint): add ts-expect-error descriptions

pull/336/head
xingyu4j 2026-03-14 13:27:00 +08:00
parent 8daf9a3ce5
commit cb98b3a47e
31 changed files with 42 additions and 40 deletions

View File

@ -22,7 +22,7 @@ import {
import { Button, ButtonGroup, message, Modal, Tooltip } from 'ant-design-vue';
//
// @ts-expect-error
// @ts-expect-error: token simulation package does not ship compatible types
import tokenSimulation from 'bpmn-js-token-simulation';
import BpmnModeler from 'bpmn-js/lib/Modeler';
//
@ -132,7 +132,7 @@ const emit = defineEmits([
'element-click',
]);
// @ts-expect-error
// @ts-expect-error: file input ref is set imperatively by the template
const bpmnCanvas = ref();
const refFile = ref();

View File

@ -39,7 +39,7 @@ watch(
val +=
props.businessObject.eventDefinitions[0]?.$type.split(':')[1] || '';
}
// @ts-expect-error
// @ts-expect-error: async component registry is indexed dynamically
customConfigComponent.value = (
CustomConfigMap as Record<string, { component: Component }>
)[val]?.component;

View File

@ -53,7 +53,7 @@ watch(
() => props.type,
() => {
if (props.type) {
// @ts-expect-error
// @ts-expect-error: installed task component map is indexed dynamically
witchTaskComponent.value = installedComponent[props.type].component;
}
},

View File

@ -65,7 +65,7 @@ const initCallActivity = () => {
//
Object.keys(formData.value).forEach((key: string) => {
// @ts-expect-error
// @ts-expect-error: form state is updated through dynamic schema keys
formData.value[key] =
bpmnElement.value.businessObject[key] ??
formData.value[key as keyof FormData];

View File

@ -70,6 +70,7 @@ const deptTreeOptions = ref<any>(); // 部门树
const postOptions = ref<SystemPostApi.Post[]>([]); //
const userOptions = ref<SystemUserApi.User[]>([]); //
const userGroupOptions = ref<BpmUserGroupApi.UserGroup[]>([]); //
// @ts-expect-error: tree ref instance type is provided by the UI library at runtime
const treeRef = ref<any>();
const { formFieldOptions } = useFormFieldsPermission(FieldPermissionType.READ);
@ -128,7 +129,7 @@ const resetTaskForm = () => {
// eslint-disable-next-line unicorn/prefer-switch
if (userTaskForm.value.candidateStrategy === CandidateStrategy.EXPRESSION) {
// input
// @ts-expect-error
// @ts-expect-error: expression strategy stores a scalar in an array-shaped field
userTaskForm.value.candidateParam = [candidateParamStr];
} else if (
userTaskForm.value.candidateStrategy ===
@ -152,7 +153,7 @@ const resetTaskForm = () => {
userTaskForm.value.candidateStrategy ===
CandidateStrategy.START_USER_MULTI_LEVEL_DEPT_LEADER
) {
// @ts-expect-error
// @ts-expect-error: dynamic candidate param shape varies by strategy
userTaskForm.value.candidateParam = +candidateParamStr;
deptLevel.value = +candidateParamStr;
} else if (
@ -303,7 +304,7 @@ const openProcessExpressionDialog = async () => {
const selectProcessExpression = (
expression: BpmProcessExpressionApi.ProcessExpression,
) => {
// @ts-expect-error
// @ts-expect-error: modal helper exposes runtime methods outside static typing
userTaskForm.value.candidateParam = [expression.expression];
updateElementTask();
};
@ -311,7 +312,7 @@ const selectProcessExpression = (
const handleFormUserChange = (e: any) => {
if (e === 'PROCESS_START_USER_ID') {
userTaskForm.value.candidateParam = [];
// @ts-expect-error
// @ts-expect-error: modal helper exposes runtime methods outside static typing
userTaskForm.value.candidateStrategy = CandidateStrategy.START_USER;
}
updateElementTask();

View File

@ -71,7 +71,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
useNodeName(BpmNodeTypeEnum.TRIGGER_NODE);
//

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
const currentNode = useWatchNode(props);
/** 节点名称编辑 */
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.CHILD_PROCESS_NODE,

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.COPY_TASK_NODE,

View File

@ -29,7 +29,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.DELAY_TIMER_NODE,

View File

@ -32,7 +32,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.ROUTER_BRANCH_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.START_USER_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.USER_TASK_NODE,

View File

@ -29,7 +29,7 @@ watch(
async (newModelView) => {
//
if (newModelView) {
// @ts-expect-error
// @ts-expect-error: viewer instance type is broader than local ref typing
view.value = newModelView;
}
},

View File

@ -107,6 +107,7 @@ const nodeTypeName = ref('审批'); // 节点类型名称
const reasonRequire = ref();
const approveFormRef = ref<FormInstance>(); //
// @ts-expect-error: template ref is retained for future provider expansion
const approveSignFormRef = ref();
const nextAssigneesActivityNode = ref<BpmProcessInstanceApi.ApprovalNodeInfo[]>(
[],

View File

@ -65,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
modalApi.lock();
try {
formData.value = await getTenant(data.id);
// @ts-expect-error https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/ID43CX
// @ts-expect-error: special-case workaround for yudao-ui-admin-vben issue ID43CX
formData.value.expireTime = String(formData.value.expireTime);
// values
await formApi.setValues(formData.value);

View File

@ -21,7 +21,7 @@ import {
} from '@vben/icons';
//
// @ts-expect-error
// @ts-expect-error: token simulation package does not ship compatible types
import tokenSimulation from 'bpmn-js-token-simulation';
import BpmnModeler from 'bpmn-js/lib/Modeler';
import {
@ -139,7 +139,7 @@ const emit = defineEmits([
'element-click',
]);
//@ts-expect-error unused-imports/no-unused-vars
// @ts-expect-error: file input ref is set imperatively by the template
const bpmnCanvas = ref();
const refFile = ref();

View File

@ -39,7 +39,7 @@ watch(
val +=
props.businessObject.eventDefinitions[0]?.$type.split(':')[1] || '';
}
// @ts-expect-error
// @ts-expect-error: async component registry is indexed dynamically
customConfigComponent.value = (
CustomConfigMap as Record<string, { component: Component }>
)[val]?.component;

View File

@ -53,7 +53,7 @@ watch(
() => props.type,
() => {
if (props.type) {
// @ts-expect-error
// @ts-expect-error: installed task component map is indexed dynamically
witchTaskComponent.value = installedComponent[props.type].component;
}
},

View File

@ -65,7 +65,7 @@ const initCallActivity = () => {
//
Object.keys(formData.value).forEach((key: string) => {
// @ts-expect-error
// @ts-expect-error: form state is updated through dynamic schema keys
formData.value[key] =
bpmnElement.value.businessObject[key] ??
formData.value[key as keyof FormData];

View File

@ -27,7 +27,7 @@ const bpmnInstances = () => (window as any)?.bpmnInstances;
const resetTaskForm = () => {
for (const key in defaultTaskForm.value) {
// @ts-expect-error
// @ts-expect-error: form state is updated through dynamic schema keys
scriptTaskForm.value[key] =
bpmnElement.value?.businessObject[
key as keyof typeof defaultTaskForm.value

View File

@ -70,7 +70,7 @@ const deptTreeOptions = ref<any>(); // 部门树
const postOptions = ref<SystemPostApi.Post[]>([]); //
const userOptions = ref<SystemUserApi.User[]>([]); //
const userGroupOptions = ref<BpmUserGroupApi.UserGroup[]>([]); //
// @ts-expect-error
// @ts-expect-error: tree ref instance type is provided by the UI library at runtime
const treeRef = ref<any>();
const { formFieldOptions } = useFormFieldsPermission(FieldPermissionType.READ);
@ -129,7 +129,7 @@ const resetTaskForm = () => {
// eslint-disable-next-line unicorn/prefer-switch
if (userTaskForm.value.candidateStrategy === CandidateStrategy.EXPRESSION) {
// input
// @ts-expect-error
// @ts-expect-error: expression strategy stores a scalar in an array-shaped field
userTaskForm.value.candidateParam = [candidateParamStr];
} else if (
userTaskForm.value.candidateStrategy ===
@ -153,7 +153,7 @@ const resetTaskForm = () => {
userTaskForm.value.candidateStrategy ===
CandidateStrategy.START_USER_MULTI_LEVEL_DEPT_LEADER
) {
// @ts-expect-error
// @ts-expect-error: dynamic candidate param shape varies by strategy
userTaskForm.value.candidateParam = +candidateParamStr;
deptLevel.value = +candidateParamStr;
} else if (
@ -304,7 +304,7 @@ const openProcessExpressionDialog = async () => {
const selectProcessExpression = (
expression: BpmProcessExpressionApi.ProcessExpression,
) => {
// @ts-expect-error
// @ts-expect-error: modal helper exposes runtime methods outside static typing
userTaskForm.value.candidateParam = [expression.expression];
updateElementTask();
};
@ -312,7 +312,7 @@ const selectProcessExpression = (
const handleFormUserChange = (e: any) => {
if (e === 'PROCESS_START_USER_ID') {
userTaskForm.value.candidateParam = [];
// @ts-expect-error
// @ts-expect-error: modal helper exposes runtime methods outside static typing
userTaskForm.value.candidateStrategy = CandidateStrategy.START_USER;
}
updateElementTask();

View File

@ -73,7 +73,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
useNodeName(BpmNodeTypeEnum.COPY_TASK_NODE);
@ -284,7 +284,7 @@ defineExpose({ showCopyTaskNodeConfig }); // 暴露方法给父组件
:data="deptTreeOptions"
:props="{
label: 'name',
// @ts-expect-error
// @ts-expect-error: dynamic node config access is narrower than runtime shape
value: 'id',
children: 'children',
}"

View File

@ -70,7 +70,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
useNodeName(BpmNodeTypeEnum.TRIGGER_NODE);
//

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
const currentNode = useWatchNode(props);
/** 节点名称编辑 */
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.CHILD_PROCESS_NODE,

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.COPY_TASK_NODE,

View File

@ -29,7 +29,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.DELAY_TIMER_NODE,

View File

@ -32,7 +32,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.ROUTER_BRANCH_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.START_USER_NODE,

View File

@ -34,7 +34,7 @@ const readonly = inject<boolean>('readonly');
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.TRIGGER_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
//
const currentNode = useWatchNode(props);
//
// @ts-expect-error
// @ts-expect-error: composable typing does not preserve this node schema exactly
const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode,
BpmNodeTypeEnum.USER_TASK_NODE,

View File

@ -29,7 +29,7 @@ watch(
async (newModelView) => {
//
if (newModelView) {
// @ts-expect-error
// @ts-expect-error: viewer instance type is broader than local ref typing
view.value = newModelView;
}
},