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
redux
David Majda 8 years ago
parent b5bd30c813
commit a733beb933

@ -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

Loading…
Cancel
Save