Allow `ignore spaces around declaration` to work when `preserve single line statements` is set to false (#34959) * Add tests for 31868 * interim fix * Fix check for flag