From 64de192868bb45cd4f87f8c782c2667499e8be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=9A=E8=B0=94=E7=9A=84=E7=8C=AB?= Date: Sat, 30 Sep 2017 00:39:40 +0800 Subject: [PATCH] Fix: id-match mysteriously fails when defined in a comment. (fixes #9366) --- lib/linter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.js b/lib/linter.js index 8f1520aafb47..7d88436767ec 100755 --- a/lib/linter.js +++ b/lib/linter.js @@ -94,7 +94,7 @@ function parseJsonConfig(string, location) { // Parses a JSON-like comment by the same way as parsing CLI option. try { - items = levn.parse("Object", string) || {}; + items = levn.parse("Object", string.replace(/\\/g, "\\\\")) || {}; // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`. // Also, commaless notations have invalid severity: