From a30bf55e69433bf5fea0f75f93fd28c5c2e96c52 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 30 May 2018 14:31:23 +0200 Subject: [PATCH] lib: use focused ESLint disabling in util.js Instead of disabling all ESLint rules for two lines that require a violation of no-control-regex, disable only the no-control-regex rule. PR-URL: https://github.com/nodejs/node/pull/21041 Reviewed-By: Gus Caplan Reviewed-By: Vse Mozhet Byt Reviewed-By: Trivikram Kamat Reviewed-By: Weijia Wang Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- lib/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index 900ced1b461..5a4e52b6267 100644 --- a/lib/util.js +++ b/lib/util.js @@ -87,10 +87,11 @@ const errorToString = Error.prototype.toString; let CIRCULAR_ERROR_MESSAGE; let internalDeepEqual; -/* eslint-disable */ +/* eslint-disable no-control-regex */ const strEscapeSequencesRegExp = /[\x00-\x1f\x27\x5c]/; const strEscapeSequencesReplacer = /[\x00-\x1f\x27\x5c]/g; -/* eslint-enable */ +/* eslint-enable no-control-regex */ + const keyStrRegExp = /^[a-zA-Z_][a-zA-Z_0-9]*$/; const numberRegExp = /^(0|[1-9][0-9]*)$/;