Here is 2021 IRC
SECTION R309
GARAGES AND CARPORTS
R309.1 Floor surface.
Garage floor surfaces shall be of approved noncombustible material.
The area of floor used for parking of automobiles or other vehicles shall be sloped to facilitate the movement of liquids to a drain or toward the main vehicle entry doorway.
I think most would interpret this to mean if you can pull a car into it and park it there, it's sloped - either to the door or a drain. There may be local amendments or interpretations that modify this. Here, for whatever reason, does not apply to detached buildings.
It does in my mind go beyond intended purpose of the code. I think today it's reasonably safe to not be sloped.
R101.3 Purpose.
The purpose of this code is to establish minimum requirements to provide a reasonable level of safety, health and general welfare through affordability, structural strength, means of egress, stability, sanitation, light and ventilation, energy conservation and safety to life and property from fire and other hazards and to provide a reasonable level of safety to fire fighters and emergency responders during emergency operations.