diff --git a/crates/oxc_linter/src/rules/eslint/no_extend_native.rs b/crates/oxc_linter/src/rules/eslint/no_extend_native.rs index ce652652307a5..540fac67c3267 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extend_native.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extend_native.rs @@ -115,6 +115,7 @@ impl Rule for NoExtendNative { OxcDiagnostic::error(format!( "{name} prototype is read-only, properties should not be added." )) + .with_help("Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype.") .with_label(prop_assign.span()), ); } @@ -126,6 +127,7 @@ impl Rule for NoExtendNative { OxcDiagnostic::error(format!( "{name} prototype is read-only, properties should not be added." )) + .with_help("Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype.") .with_label(define_property_call.span()), ); } diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_backreference.rs b/crates/oxc_linter/src/rules/eslint/no_useless_backreference.rs index 6465a5fe4e738..a6191e9b8488d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_backreference.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_backreference.rs @@ -15,13 +15,26 @@ fn no_useless_backreference_diagnostic( back_reference: &str, group: &str, ) -> OxcDiagnostic { - match problem { - Problem::Nested =>OxcDiagnostic::warn(format!("Backreference '{back_reference}' will be ignored. It references group '{group}' from within that group.")).with_label(span), - Problem::Disjunctive => OxcDiagnostic::warn(format!("Backreference '{back_reference}' will be ignored. It references group '{group}' which is in another alternative.")).with_label(span), - Problem::Forward => OxcDiagnostic::warn(format!("Backreference '{back_reference}' will be ignored. It references group '{group}' which appears later in the pattern.")).with_label(span), - Problem::Backward => OxcDiagnostic::warn(format!("Backreference '{back_reference}' will be ignored. It references group '{group}' which appears before in the same lookbehind.")).with_label(span), - Problem::IntoNegativeLookaround => OxcDiagnostic::warn(format!("Backreference '{back_reference}' will be ignored. It references group '{group}' which is in a negative lookaround.")).with_label(span), - } + let diagnostic = match problem { + Problem::Nested => OxcDiagnostic::warn(format!( + "Backreference '{back_reference}' will be ignored. It references group '{group}' from within that group." + )), + Problem::Disjunctive => OxcDiagnostic::warn(format!( + "Backreference '{back_reference}' will be ignored. It references group '{group}' which is in another alternative." + )), + Problem::Forward => OxcDiagnostic::warn(format!( + "Backreference '{back_reference}' will be ignored. It references group '{group}' which appears later in the pattern." + )), + Problem::Backward => OxcDiagnostic::warn(format!( + "Backreference '{back_reference}' will be ignored. It references group '{group}' which appears before in the same lookbehind." + )), + Problem::IntoNegativeLookaround => OxcDiagnostic::warn(format!( + "Backreference '{back_reference}' will be ignored. It references group '{group}' which is in a negative lookaround." + )), + }; + diagnostic + .with_help("Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation.") + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/snapshots/eslint_no_extend_native.snap b/crates/oxc_linter/src/snapshots/eslint_no_extend_native.snap index e93c463c597de..688d6454ad48d 100644 --- a/crates/oxc_linter/src/snapshots/eslint_no_extend_native.snap +++ b/crates/oxc_linter/src/snapshots/eslint_no_extend_native.snap @@ -7,159 +7,186 @@ source: crates/oxc_linter/src/tester.rs 1 │ Object.prototype.p = 0 · ────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): BigInt prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ BigInt.prototype.p = 0 · ────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): WeakRef prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ WeakRef.prototype.p = 0 · ─────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): FinalizationRegistry prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ FinalizationRegistry.prototype.p = 0 · ──────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): AggregateError prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ AggregateError.prototype.p = 0 · ────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Function prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Function.prototype['p'] = 0 · ─────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): String prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ String['prototype'].p = 0 · ───────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Number prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Number['prototype']['p'] = 0 · ──────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object.defineProperty(Array.prototype, 'p', {value: 0}) · ─────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object['defineProperty'](Array.prototype, 'p', {value: 0}) · ────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object['defineProperty'](Array['prototype'], 'p', {value: 0}) · ───────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object.defineProperties(Array.prototype, {p: {value: 0}}) · ───────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object.defineProperties(Array.prototype, {p: {value: 0}, q: {value: 0}}) · ──────────────────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Number prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Number['prototype']['p'] = 0 · ──────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object.prototype.p = 0; Object.prototype.q = 0 · ────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:25] 1 │ Object.prototype.p = 0; Object.prototype.q = 0 · ────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:18] 1 │ function foo() { Object.prototype.p = 0 } · ────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ (Object?.prototype).p = 0 · ───────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ (Object?.['prototype'])['p'] = 0 · ──────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object.defineProperty(Object?.prototype, 'p', { value: 0 }) · ─────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object?.defineProperty(Object.prototype, 'p', { value: 0 }) · ─────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Object?.['defineProperty'](Object?.['prototype'], 'p', {value: 0}) · ────────────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Object prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ (Object?.defineProperty)(Object.prototype, 'p', { value: 0 }) · ───────────────────────────────────────────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Array.prototype.p &&= 0 · ─────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Array.prototype.p ||= 0 · ─────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ Array.prototype.p ??= 0 · ─────────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. ⚠ eslint(no-extend-native): Array prototype is read-only, properties should not be added. ╭─[no_extend_native.tsx:1:1] 1 │ [Array.prototype.p] = [() => {}] · ─────────────────── ╰──── + help: Consider using a utility function or a class that extends the built-in object instead of defining properties on the prototype. diff --git a/crates/oxc_linter/src/snapshots/eslint_no_useless_backreference.snap b/crates/oxc_linter/src/snapshots/eslint_no_useless_backreference.snap index 73f8015f201e3..e0e58d49d7b7c 100644 --- a/crates/oxc_linter/src/snapshots/eslint_no_useless_backreference.snap +++ b/crates/oxc_linter/src/snapshots/eslint_no_useless_backreference.snap @@ -7,555 +7,648 @@ source: crates/oxc_linter/src/tester.rs 1 │ /(b)(\2a)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\k(?bar)/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\\1' will be ignored. It references group '(a|bc)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:16] 1 │ RegExp('(a|bc)|\\1') · ─── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\\1' will be ignored. It references group '(?\\n)' which is in a negative lookaround. ╭─[no_useless_backreference.tsx:1:28] 1 │ new RegExp('(?!(?\\n))\\1') · ─── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a)' which appears later in the pattern. ╭─[no_useless_backreference.tsx:1:9] 1 │ /(?(.)b\1)' from within that group. ╭─[no_useless_backreference.tsx:1:14] 1 │ /a(?(.)b\1)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?\k)' from within that group. ╭─[no_useless_backreference.tsx:1:10] 1 │ /a(?\k)b/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(\1)' from within that group. ╭─[no_useless_backreference.tsx:1:4] 1 │ /^(\1)*$/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '((?:\1))' from within that group. ╭─[no_useless_backreference.tsx:1:15] 1 │ /^(?:a)(?:((?:\1)))*$/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(\1)' from within that group. ╭─[no_useless_backreference.tsx:1:6] 1 │ /(?!(\1))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(b\1c)' from within that group. ╭─[no_useless_backreference.tsx:1:6] 1 │ /a|(b\1c)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a|(\1))' from within that group. ╭─[no_useless_backreference.tsx:1:6] 1 │ /(a|(\1))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\2' will be ignored. It references group '(\2)' from within that group. ╭─[no_useless_backreference.tsx:1:6] 1 │ /(a|(\2))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(\1)' from within that group. ╭─[no_useless_backreference.tsx:1:8] 1 │ /(?:a|(\1))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\3' will be ignored. It references group '(\3)' from within that group. ╭─[no_useless_backreference.tsx:1:11] 1 │ /(a)?(b)*(\3)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a\1)' from within that group. ╭─[no_useless_backreference.tsx:1:8] 1 │ /(?<=(a\1))b/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\1(a)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\1.(a)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:5] 1 │ /(?:\1)(?:(a))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '((a))' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:5] 1 │ /(?:\1)(?:((a)))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\2' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:5] 1 │ /(?:\2)(?:((a)))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '((?:a))' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:5] 1 │ /(?:\1)(?:((?:a)))/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\2' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:3] 1 │ /(\2)(a)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\\2' will be ignored. It references group '(b)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:12] 1 │ RegExp('(a)\\2(b)') · ─── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\2' will be ignored. It references group '(c)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:10] 1 │ /(?:a)(b)\2(c)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\k(?a)/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\2' will be ignored. It references group '(c)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:9] 1 │ /(?:a(b)\2)(c)/ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\\3' will be ignored. It references group '(c)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:19] 1 │ new RegExp('(a)(b)\\3(c)') · ─── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\1(?<=(a))./ · ── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\1' will be ignored. It references group '(a)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\1(?' will be ignored. It references group '(?bar)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\k((?bar)|(?baz))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:15] 1 │ /((?bar)|\k(?baz))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which appears before in the same lookbehind. ╭─[no_useless_backreference.tsx:1:2] 1 │ /\k((?bar)|(?baz)|(?qux))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:15] 1 │ /((?bar)|\k(?baz)|(?qux))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:15] 1 │ /((?bar)|\k|(?baz))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:15] 1 │ /((?bar)|\k|(?baz)|(?qux))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:25] 1 │ /((?bar)|(?baz\k)|(?qux\k))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in another alternative. ╭─[no_useless_backreference.tsx:1:44] 1 │ /((?bar)|(?baz\k)|(?qux\k))/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which appears later in the pattern. ╭─[no_useless_backreference.tsx:1:31] 1 │ /(?<=((?bar)|(?baz))\k)/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation. ⚠ eslint(no-useless-backreference): Backreference '\k' will be ignored. It references group '(?bar)' which is in a negative lookaround. ╭─[no_useless_backreference.tsx:1:35] 1 │ /((?!(?bar))|(?!(?baz)))\k/ · ─────── ╰──── + help: Consider revising the pattern to remove or relocate the backreference so it points to a group that can be matched at the time of evaluation.