Skip to content
Permalink
Browse files

Chore: refactor regex in config comment parser (#12662)

  • Loading branch information
mdjermanovic authored and kaicataldo committed Dec 20, 2019
1 parent 1600648 commit 7171fca6ef4e0e8f267658fc7d8f603f00eddd84
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/linter/config-comment-parser.js
@@ -90,7 +90,7 @@ module.exports = class ConfigCommentParser {
* But we are supporting that. So this is a fallback for that.
*/
items = {};
const normalizedString = string.replace(/([a-zA-Z0-9\-/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,");
const normalizedString = string.replace(/([-a-zA-Z0-9/]+):/gu, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/u, "$1,");

try {
items = JSON.parse(`{${normalizedString}}`);

0 comments on commit 7171fca

Please sign in to comment.
You can’t perform that action at this time.