homarr-labs / homarr

Detected usage of void type outside of generic or return types JS-0333
Anti-pattern
Minor
3 days ago7 months old
void is only valid as a return type or generic type argument
17  expirationDate: Date;
18}
19
20export const InviteCreateModal = createModal<void>(({ actions }) => {21  const tInvite = useScopedI18n("management.page.user.invite");
22  const t = useI18n();
23  const { openModal } = useModalAction(InviteCopyModal);
void is only valid as a return type or generic type argument
28  );
29};
30
31const AddGroupModal = createModal<void>(({ actions }) => {32  const t = useI18n();
33  const { mutate, isPending } = clientApi.group.createGroup.useMutation();
34  const form = useZodForm(validation.group.create, {
void is only valid as a return type or generic type argument
56 * Otherwise it will return void (as type).
57 */
58export const checkCron = <const T extends string>(cron: T) => {
59  return cron as ValidateCron<T> extends true ? T : void;60};
void is only valid as a return type or generic type argument
 9
10import { useItemActions } from "./item-actions";
11
12export const ItemSelectModal = createModal<void>(({ actions }) => {13  return (
14    <Grid>
15      {objectEntries(widgetImports).map(([key, value]) => {
void is not valid as a constituent in a union type
137  if (!context) throw new Error("ModalContext is not provided");
138
139  return {
140    openModal: (innerProps: inferInnerProps<TModal>, options: OpenModalOptions | void) => {141      // void actually is undefined
142      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
143      context.openModalInner({ modal, innerProps, options: options ?? {} });