I think the solution to this would be using an auto-formatter that supports “leave this formatting alone” directives and adding them to your code where needed:
// convert from screen coords to clip space
// formatting-preserve-start
clipX = mouseX / screenWidth * 2 - 1
clipY = mouseY / screenHeight * -2 + 1
// formatting-preserve-end
That way you get the benefit of easy, convenient consistent formatting in the rest of your file at the expense of a few extra comments here and there.
Sadly, ignore comments of the Prettier formatter (https://prettier.io/docs/en/ignore.html) are not this powerful – they only support ignoring the next line of code.
Sadly, ignore comments of the Prettier formatter (https://prettier.io/docs/en/ignore.html) are not this powerful – they only support ignoring the next line of code.