Skip to content

Commit

Permalink
Chore: refactor regex in config comment parser (#12662)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored and kaicataldo committed Dec 20, 2019
1 parent 1600648 commit 7171fca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/linter/config-comment-parser.js
Expand Up @@ -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}}`);
Expand Down

0 comments on commit 7171fca

Please sign in to comment.