Improve eslint rules for unused vars

This commit is contained in:
Alex Gleason committed 2025-06-01 17:28:25 -05:00
1 parent 8bdff8da6d
commit 1fc548c7e9
4 files changed
+14 -16

No files matched your search

+4 -13
View File
@@ -15,13 +15,6 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement
}
const actionTypes = {
ADD_TOAST: "ADD_TOAST",
UPDATE_TOAST: "UPDATE_TOAST",
DISMISS_TOAST: "DISMISS_TOAST",
REMOVE_TOAST: "REMOVE_TOAST",
} as const
let count = 0
function genId() {
@@ -29,23 +22,21 @@ function genId() {
return count.toString()
}
type ActionType = typeof actionTypes
type Action =
| {
type: ActionType["ADD_TOAST"]
type: "ADD_TOAST";
toast: ToasterToast
}
| {
type: ActionType["UPDATE_TOAST"]
type: "UPDATE_TOAST";
toast: Partial<ToasterToast>
}
| {
type: ActionType["DISMISS_TOAST"]
type: "DISMISS_TOAST";
toastId?: ToasterToast["id"]
}
| {
type: ActionType["REMOVE_TOAST"]
type: "REMOVE_TOAST";
toastId?: ToasterToast["id"]
}