You can use the YAML-like declarative syntax [1] instead to configure the pipelines for 90% of what you do, and just use Apache Groovy for the more complex logic, or interfacing with plugins.
I am using the declarative syntax. It's just as horrible to debug. Play around with it a bit, delete some characters, misconfigure it. You won't even get a line number, just as I said.
[1] https://jenkins.io/doc/book/pipeline/syntax/