diff --git a/src/extensions/default/JSLint/main.js b/src/extensions/default/JSLint/main.js index c3ec9705dcc..c0116314a47 100644 --- a/src/extensions/default/JSLint/main.js +++ b/src/extensions/default/JSLint/main.js @@ -71,16 +71,8 @@ define(function (require, exports, module) { * a gold star when no errors are found. */ function lintOneFile(text, fullPath) { - // If a line contains only whitespace, remove the whitespace - // This should be doable with a regexp: text.replace(/\r[\x20|\t]+\r/g, "\r\r");, - // but that doesn't work. - var i, arr = text.split("\n"); - for (i = 0; i < arr.length; i++) { - if (!arr[i].match(/\S/)) { - arr[i] = ""; - } - } - text = arr.join("\n"); + // If a line contains only whitespace (here spaces or tabs), remove the whitespace + text = text.replace(/^[ \t]+$/gm, ""); var options = prefs.get("options");