diff --git a/lib/util/labelUtils.ts b/lib/util/labelUtils.ts index 25b65ce..5575e78 100644 --- a/lib/util/labelUtils.ts +++ b/lib/util/labelUtils.ts @@ -41,7 +41,7 @@ const hasLabelWithHtmlForId = (idValue: string, context: TSESLint.RuleContext]*\bid\b\s*=\s*["{']([^"'{}]*)["'}]/gi; + const regex = /<(Label|label)[^>]*\bhtmlFor\b\s*=\s*["{']([^"'{}]*)["'}]/gi; let match; while ((match = regex.exec(sourceCode.text)) !== null) {