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'; 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 tokenSimulation from 'bpmn-js-token-simulation';
import BpmnModeler from 'bpmn-js/lib/Modeler'; import BpmnModeler from 'bpmn-js/lib/Modeler';
// //
@ -132,7 +132,7 @@ const emit = defineEmits([
'element-click', 'element-click',
]); ]);
// @ts-expect-error // @ts-expect-error: file input ref is set imperatively by the template
const bpmnCanvas = ref(); const bpmnCanvas = ref();
const refFile = ref(); const refFile = ref();

View File

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

View File

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

View File

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

View File

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

View File

@ -71,7 +71,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
// //
const currentNode = useWatchNode(props); 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 } = const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
useNodeName(BpmNodeTypeEnum.TRIGGER_NODE); useNodeName(BpmNodeTypeEnum.TRIGGER_NODE);
// //

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.CHILD_PROCESS_NODE, BpmNodeTypeEnum.CHILD_PROCESS_NODE,

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.COPY_TASK_NODE, BpmNodeTypeEnum.COPY_TASK_NODE,

View File

@ -29,7 +29,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.DELAY_TIMER_NODE, BpmNodeTypeEnum.DELAY_TIMER_NODE,

View File

@ -32,7 +32,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.ROUTER_BRANCH_NODE, BpmNodeTypeEnum.ROUTER_BRANCH_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.START_USER_NODE, BpmNodeTypeEnum.START_USER_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.USER_TASK_NODE, BpmNodeTypeEnum.USER_TASK_NODE,

View File

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

View File

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

View File

@ -65,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
modalApi.lock(); modalApi.lock();
try { try {
formData.value = await getTenant(data.id); 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); formData.value.expireTime = String(formData.value.expireTime);
// values // values
await formApi.setValues(formData.value); await formApi.setValues(formData.value);

View File

@ -21,7 +21,7 @@ import {
} from '@vben/icons'; } 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 tokenSimulation from 'bpmn-js-token-simulation';
import BpmnModeler from 'bpmn-js/lib/Modeler'; import BpmnModeler from 'bpmn-js/lib/Modeler';
import { import {
@ -139,7 +139,7 @@ const emit = defineEmits([
'element-click', '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 bpmnCanvas = ref();
const refFile = ref(); const refFile = ref();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -70,7 +70,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
// //
const currentNode = useWatchNode(props); 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 } = const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
useNodeName(BpmNodeTypeEnum.TRIGGER_NODE); useNodeName(BpmNodeTypeEnum.TRIGGER_NODE);
// //

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.CHILD_PROCESS_NODE, BpmNodeTypeEnum.CHILD_PROCESS_NODE,

View File

@ -31,7 +31,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.COPY_TASK_NODE, BpmNodeTypeEnum.COPY_TASK_NODE,

View File

@ -29,7 +29,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.DELAY_TIMER_NODE, BpmNodeTypeEnum.DELAY_TIMER_NODE,

View File

@ -32,7 +32,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.ROUTER_BRANCH_NODE, BpmNodeTypeEnum.ROUTER_BRANCH_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.START_USER_NODE, BpmNodeTypeEnum.START_USER_NODE,

View File

@ -34,7 +34,7 @@ const readonly = inject<boolean>('readonly');
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.TRIGGER_NODE, BpmNodeTypeEnum.TRIGGER_NODE,

View File

@ -37,7 +37,7 @@ const tasks = inject<Ref<any[]>>('tasks', ref([]));
// //
const currentNode = useWatchNode(props); 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( const { showInput, changeNodeName, clickTitle, inputRef } = useNodeName2(
currentNode, currentNode,
BpmNodeTypeEnum.USER_TASK_NODE, BpmNodeTypeEnum.USER_TASK_NODE,

View File

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