The ECJ is part of the EU. Are you thinking of the European Court of Human Rights? This isn't part of the EU and, whilst people have talked about leaving it no one has stated it as policy.
If we don't leave the ECJ then we aren't leaving the EU. But we're not leaving the ECHR