Type CustomPipe is part of the declarations of 2 modules

I create my custom Pipe and I need to use it in several custom component.

If I add Pipe into declaration array of 2 or more modules I receive this error:

ERROR Error: Uncaught (in promise): Error: Type CustomPipe is part of the declarations of 2 modules: MainSliderComponentModule and MatchType3ComponentModule! Please consider moving CustomPipe to a higher module that imports MainSliderComponentModule and MatchType3ComponentModule. You can also create a new NgModule that exports and includes CustomPipe then import that NgModule in MainSliderComponentModule and MatchType3ComponentModule.

What is the best solution?