From 2296cd1a4d6718e1935e1663fef67e9002970bb9 Mon Sep 17 00:00:00 2001 From: yeting li Date: Thu, 8 Oct 2020 10:49:21 +0800 Subject: [PATCH] Fix ReDos in valid-var-jsdoc.js --- lib/js/rules/valid-var-jsdoc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/js/rules/valid-var-jsdoc.js b/lib/js/rules/valid-var-jsdoc.js index e77124dd..e42cd482 100644 --- a/lib/js/rules/valid-var-jsdoc.js +++ b/lib/js/rules/valid-var-jsdoc.js @@ -25,7 +25,7 @@ module.exports = { * @const * @type {RegExp} */ - var CONST_PATTERN = /^[A-Z]([A-Z\d$]+_?)*[A-Z\d$]$/; + var CONST_PATTERN = /^[A-Z]([A-Z\d$]_?)*[A-Z\d$]$/; /** * 匹配 Pascal 命名 @@ -33,7 +33,7 @@ module.exports = { * @const * @type {RegExp} */ - var PASCAL_PATTERN = /^([A-Z][a-zA-Z\d$]+)+$/; + var PASCAL_PATTERN = /^([A-Z][a-zA-Z\d$]+)$/; /** * 匹配 Camel 命名