D8. How can check is a formatter in use? I contribute a module that provides additional formatters for the core image and link fields.

To protect the module from uninstall, I need a possibility to check if a providet formatter used on a image or link field.

To do this, I use the hook_system_info_alter() with

$info['required'] = TRUE;
$info['explanation'] = t('Field formatter(s) in use');


Someone has an idea?
Solved.

See the function dsbox_system_info_alter() of the Drupal Swipebox module to get detailed informations of the solution.
Or, here is the link to the code of the module file: dsbox.module