diff --git a/lib/linter.js b/lib/linter.js index e96e713ffdb7..c5d57629fcd6 100755 --- a/lib/linter.js +++ b/lib/linter.js @@ -94,6 +94,10 @@ function parseJsonConfig(string, location) { // Parses a JSON-like comment by the same way as parsing CLI option. try { + + // https://github.com/eslint/eslint/issues/9366 + string = string.replace(/\\\\/g, "\\"); + items = levn.parse("Object", string) || {}; // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`.