How far from the garbage disposal should the switch be to meet code?
You can have the switch adjacent to the sink. As far as code the national electric code has no specific limitations on the switch location, it has a specific length for the power cord of 18”-36” per NEC 422.16. But there is not a defined location for the switch. You probably would want it within 2’ similar to the current requirement for outlet spacing.