summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/rules/no-irregular-whitespace.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/lib/rules/no-irregular-whitespace.js')
-rw-r--r--tools/eslint/lib/rules/no-irregular-whitespace.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/eslint/lib/rules/no-irregular-whitespace.js b/tools/eslint/lib/rules/no-irregular-whitespace.js
index b1949fbc73..3882501a86 100644
--- a/tools/eslint/lib/rules/no-irregular-whitespace.js
+++ b/tools/eslint/lib/rules/no-irregular-whitespace.js
@@ -7,13 +7,19 @@
"use strict";
//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("../ast-utils");
+
+//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------
const ALL_IRREGULARS = /[\f\v\u0085\u00A0\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/;
const IRREGULAR_WHITESPACE = /[\f\v\u0085\u00A0\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mg;
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/mg;
-const LINE_BREAK = /\r\n|\r|\n|\u2028|\u2029/g;
+const LINE_BREAK = astUtils.createGlobalLinebreakMatcher();
//------------------------------------------------------------------------------
// Rule Definition