jslint: remove whitespaces using simple regex

Small speed improvement to the default lintjs extension. Replacing obsolete for loop with a simple regex to remove whitespaces, if a line contains only whitespace.
Why not just use `\s` for whitespace? It covers all of those cases. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-white-space