As I've outlined in this sketch; The green lines are the inductive loop between D-S (pos and gnd). This is priority number 1 - this is rather big as you can see. Also, a square is never good - you should strive to bring the leads together as much as possible. A solution would be to place a small ceramic capacitor right under the heatsink (shave some off the heatsink), this is marked in blue. If you do a PCB, witch I hope, you could mount electrolytics on the underside - and ceramics on the topside.
I'd like to add that high fet source to lower fet drain connection (phase connection point) isn't (countrary to popular belief) critical. Actually - a higher distance here will result in less ringing overshoot, a positive thing (but keep everything in moderation). When i "eliminated" phase node inductance my prototype ringing went into total avalanche mode with vds reaching 3 times input (but still within avalanche limits), and the ringing frequency was outside range of my cheap scope - with my schools expencive scope, the ringing was clear.
What actually is more important is gate driver placement. To sum up: DS decoupling first. Gate driver second. Phase node lastly.
Let me also add that running field oriented controll (or any controll method with some sort of space vector modulation) will cut down your current ripple by 60-70 % over normal six-step commutation, this is more important than optimizing layout. And before going apeshit over FOC; this is on a BLAC engine. A BLDC engine (trapezoidal bemf) with a six-step commutation can be just as efficient and well behaved as a BLAC sine controlled engine.
It's really dissappoiting to lay down countless hours down into optimizing FOC for use on a BLAC motor, then to have the same or better experience with a cheaper BLDC motor. I hate my HS3540 and 12fet for working as nicely as it does. Only optimalization is field weakening, thats as easy to implement on a blac as a bldc motor.
Getting lost in jibberish here, only want to tell you to observe the whole picture - don't overanalyse






