If I understand @avpaderno correctly, then we should not use ImageFormatter as a parent class, but work with ImageFormatterBase, which is a base class.
src/Plugin/Field/FieldFormatter/ImagelightboxFormatter.php
The \Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter class is not part of the public API and cannot be used as parent class for classes implemented by a contributed module, differently from \Drupal\image\Plugin\Field\FieldFormatter\ImageFormatterBase which is a base class and therefore part of the public API.
(see related issue → )
This applies to:
src/Plugin/Field/FieldFormatter/ImageLightboxFormatter
Active
2.2
Code