Skip to content

Commit 91855df

Browse files
committed
fix(linter): fix message in react/rules-of-hooks diagnostic (#11515)
remove redundant `Message: ` from the diagnostic
1 parent b272194 commit 91855df

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crates/oxc_linter/src/rules/react/rules_of_hooks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ mod diagnostics {
6666

6767
pub(super) fn async_component(span: Span, func_name: &str) -> OxcDiagnostic {
6868
OxcDiagnostic::warn(format!(
69-
"message: `React Hook {func_name:?} cannot be called in an async function. "
69+
"React Hook {func_name:?} cannot be called in an async function. "
7070
))
7171
.with_label(span)
7272
.with_error_code_scope(SCOPE)

crates/oxc_linter/src/snapshots/react_rules_of_hooks.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,15 +585,15 @@ source: crates/oxc_linter/src/tester.rs
585585
· ──────────
586586
╰────
587587

588-
⚠ eslint-plugin-react-hooks(rules-of-hooks): message: `React Hook "AsyncComponent" cannot be called in an async function.
588+
⚠ eslint-plugin-react-hooks(rules-of-hooks): React Hook "AsyncComponent" cannot be called in an async function.
589589
╭─[rules_of_hooks.tsx:2:32]
590590
1 │
591591
2 │ async function AsyncComponent() {
592592
· ──────────────
593593
3useState();
594594
╰────
595595

596-
eslint-plugin-react-hooks(rules-of-hooks): message: `React Hook "Anonymous" cannot be called in an async function.
596+
eslint-plugin-react-hooks(rules-of-hooks): React Hook "Anonymous" cannot be called in an async function.
597597
╭─[rules_of_hooks.tsx:2:40]
598598
1 │
599599
2 │ ╭─▶ const AsyncComponent = async () => {
@@ -602,23 +602,23 @@ source: crates/oxc_linter/src/tester.rs
602602
5
603603
╰────
604604

605-
⚠ eslint-plugin-react-hooks(rules-of-hooks): message: `React Hook "Page" cannot be called in an async function.
605+
eslint-plugin-react-hooks(rules-of-hooks): React Hook "Page" cannot be called in an async function.
606606
╭─[rules_of_hooks.tsx:2:32]
607607
1 │
608608
2 │ async function Page() {
609609
· ────
610610
3useId();
611611
╰────
612612

613-
eslint-plugin-react-hooks(rules-of-hooks): message: `React Hook "Page" cannot be called in an async function.
613+
eslint-plugin-react-hooks(rules-of-hooks): React Hook "Page" cannot be called in an async function.
614614
╭─[rules_of_hooks.tsx:2:32]
615615
1 │
616616
2 │ async function Page() {
617617
· ────
618618
3useId();
619619
╰────
620620

621-
eslint-plugin-react-hooks(rules-of-hooks): message: `React Hook "useAsyncHook" cannot be called in an async function.
621+
eslint-plugin-react-hooks(rules-of-hooks): React Hook "useAsyncHook" cannot be called in an async function.
622622
╭─[rules_of_hooks.tsx:2:32]
623623
1 │
624624
2 │ async function useAsyncHook() {
@@ -682,7 +682,7 @@ source: crates/oxc_linter/src/tester.rs
682682
5 │ }
683683
╰────
684684

685-
eslint-plugin-react-hooks(rules-of-hooks): message: `React Hook "AsyncComponent" cannot be called in an async function.
685+
eslint-plugin-react-hooks(rules-of-hooks): React Hook "AsyncComponent" cannot be called in an async function.
686686
╭─[rules_of_hooks.tsx:2:28]
687687
1 │
688688
2 │ async function AsyncComponent() {

0 commit comments

Comments
 (0)