Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit 05ed2e2

Browse files
chore: enforce use of useToastMutation (#201)
1 parent d865730 commit 05ed2e2

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

eslint.config.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import globals from "globals";
33
import reactHooks from "eslint-plugin-react-hooks";
44
import reactRefresh from "eslint-plugin-react-refresh";
55
import tseslint from "typescript-eslint";
6-
import tailwindPlugin from 'eslint-plugin-tailwindcss'
6+
import tailwindPlugin from "eslint-plugin-tailwindcss";
77

88
export default tseslint.config(
99
{ ignores: ["dist"] },
@@ -56,6 +56,18 @@ export default tseslint.config(
5656
],
5757
},
5858
],
59+
"no-restricted-imports": [
60+
"error",
61+
{
62+
paths: [
63+
{
64+
importNames: ["useMutation"],
65+
message: "Use the custom `useToastMutation` instead",
66+
name: "@tanstack/react-query",
67+
},
68+
],
69+
},
70+
],
5971
},
60-
}
72+
},
6173
);

src/hooks/use-toast-mutation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { toast } from "@stacklok/ui-kit";
22
import {
33
DefaultError,
4+
// eslint-disable-next-line no-restricted-imports
45
useMutation,
56
UseMutationOptions,
67
} from "@tanstack/react-query";

0 commit comments

Comments
 (0)