How to add BPMN JS design level validations

Hello, community.

I need to add design-level validations to my diagrams when saving them.
If the diagram is not correct, throw an alert.

For example:

  1. I need the diagram to have at least one start event.

2- I need it to have at least one final event.

3- I need it to have at least one human task event.

4- That the elements have the sequence connectors.

What do you recommend? I was observing BPMNLINT

bpmnlint is exactly what you need. It allows you to add your own rules through plugins: GitHub - bpmn-io/bpmnlint-plugin-example: A example bpmnlint plug-in