Why?
anything is possible, depends how deep your pockets are. but since you asking this question I will assume you do not have the skills to perform the swap.
the short readers digest version of what you would have to do..
most likely regear axles since most 30/20 in a CJ came with 2.73:1 and the lowest yj gears were 3.07:1
swap your T-case for a pass side drop to match the pass side diff
cut off the front axle perches since the CJ used 1.5" springs and the yj uses 2.5" springs.
new rims for the 5 on 5.5 bolt pattern
then you will have to address all the short comings of the M20 rear like the 2 piece shafts.
you best bet, look for 81+ Grand Waggy axles, will be either D44's or 44 front and M20 rear, but the 20 rear is beefier than the CJ one. plus the front diff will be on the correct side. you will still have to re-gear and new rims and junk, but you will be making an upgrade and not a lateral swap.