Less permissive copyleft licenses like GPL and AGPL go a long way toward preventing that. It’s important to choose them over weaker licenses if you don't want companies using your work without giving back. If you do that, you don't have to do other unusual things to protect your users’ rights.
Only open source it if it fucks big tech. E.g. bittorrent or an alternative browser. Or an app on your local machine as a SaaS alternative.