When I assign top-right, bottom-right to legend.inset.anchor, the following error occurred.
TypeError: Cannot read property 'getXAxisTickTextY2Overflow' of undefined
Here is chart option and you can check for errors in developer tools. Is there an option I need to add to use the anchor option?

It's because of missing false in getCurrentPaddingRight() in this line
It can be simply fixed by just adding false, but I would rather refactor getCurrentPaddingRight(withoutTickTextOverflow = false) to getCurrentPaddingRight(withXAxisTickTextOverflow = false) in size.ts so that xAxisTickTextOverflow will be 0 by default and will be only calculated if needed for autorotating x axis tick texts.
Where do you want to merge it @netil? Master with bb 2.2 or next with d3 v6?
@michkami, before the v3 release, every patch updates works need to be done on master.