From a733beb933d67b725c4972c97b8e5929792224bd Mon Sep 17 00:00:00 2001 From: David Majda Date: Thu, 1 Dec 2016 16:30:10 +0100 Subject: [PATCH] Remove unnecessary escaping of "]" in a regexp This fixes the following ESLint error, which started to appear after eslint/eslint#7424 was fixed: /Users/dmajda/Programming/PEG.js/pegjs/lib/compiler/js.js 37:17 error Unnecessary escape character: \] no-useless-escape This should fix broken Travis CI builds: https://travis-ci.org/pegjs/pegjs/builds/180092802 --- lib/compiler/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compiler/js.js b/lib/compiler/js.js index 5a2bea4..09cc713 100644 --- a/lib/compiler/js.js +++ b/lib/compiler/js.js @@ -34,7 +34,7 @@ let js = { return s .replace(/\\/g, "\\\\") // backslash .replace(/\//g, "\\/") // closing slash - .replace(/\]/g, "\\]") // closing bracket + .replace(/]/g, "\\]") // closing bracket .replace(/\^/g, "\\^") // caret .replace(/-/g, "\\-") // dash .replace(/\0/g, "\\0") // null