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: